| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503 |
- /* =========================================================
- * Cascade layer order
- *
- * theme
- * ↓
- * base
- * ↓
- * vendor.swiper
- * ↓
- * components
- * ↓
- * utilities
- * ======================================================= */
- @layer theme, base, vendor, components, utilities;
- @layer vendor.swiper;
- /* =========================================================
- * Framework / vendor imports
- *
- * 注意:
- * @import 必须位于普通 CSS rule 之前。
- * Swiper 按需引入,不建议无脑使用 swiper/css/bundle。
- * ======================================================= */
- @import "tailwindcss";
- @import "swiper/css" layer(vendor.swiper);
- @import "swiper/css/navigation" layer(vendor.swiper);
- @import "swiper/css/pagination" layer(vendor.swiper);
- @import 'swiper/css/free-mode' layer(vendor.swiper);
- @import 'swiper/css/thumbs' layer(vendor.swiper);
- /* =========================================================
- * HeroUI v2
- * ======================================================= */
- @plugin "../../hero.ts";
- @source "../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}";
- @custom-variant dark (&:is(.dark *));
- @import "../assets/styles/cms-content.css" layer(components);
- /* =========================================================
- * Tailwind theme tokens
- *
- * @theme 中的变量会映射到 Tailwind utilities。
- *
- * 例如:
- * --color-ly-gray
- * → text-ly-gray
- * → bg-ly-gray
- * → border-ly-gray
- *
- * --text-ly-16
- * → text-ly-16
- *
- * --leading-ly-24
- * → leading-ly-24
- * ======================================================= */
- @theme {
- /* ---------- Colors ---------- */
- --color-ly-inputborder: #e5e5e5;
- --color-ly-placeholder: #a6a6a6;
- --color-ly-errorcolor: #ff0000;
- --color-ly-lightgray: #f9f9f9;
- --color-ly-middlegray: #f2f2f2;
- --color-ly-gray: #d3d3d3;
- --color-ly-deepgray: #acacac;
- --color-ly-gold: #ffd700;
- --color-ly-green: #01754a;
- --color-ly-middlegreen: #036141;
- --color-ly-deepgreen: #1e3932;
- /* ---------- Font sizes ---------- */
- --text-ly-12: 0.75rem;
- --text-ly-13: 0.8125rem;
- --text-ly-14: 0.875rem;
- --text-ly-16: 1rem;
- --text-ly-18: 1.125rem;
- --text-ly-20: 1.25rem;
- --text-ly-22: 1.375rem;
- --text-ly-24: 1.5rem;
- --text-ly-30: 1.875rem;
- --text-ly-36: 2.25rem;
- --text-ly-48: 3rem;
- /* ---------- Line heights ---------- */
- --leading-ly-16: 1rem;
- --leading-ly-18: 1.125rem;
- --leading-ly-20: 1.25rem;
- --leading-ly-22: 1.375rem;
- --leading-ly-24: 1.5rem;
- --leading-ly-26: 1.625rem;
- --leading-ly-28: 1.75rem;
- --leading-ly-36: 2.25rem;
- }
- /* =========================================================
- * Runtime variables -> Tailwind theme
- *
- * inline 用于引用其它 CSS variables。
- *
- * 例如:
- *
- * --background
- * ↓
- * --color-background
- * ↓
- * bg-background
- *
- * 当 .dark 修改 --background 后,
- * bg-background 会自动跟随,不需要额外写:
- *
- * bg-white dark:bg-background
- * ======================================================= */
- @theme inline {
- --font-outfit:
- var(--font-outfit-variable),
- system-ui,
- sans-serif;
- --color-background: var(--background);
- --color-foreground: var(--foreground);
- --color-selected-black: var(--selected-black);
- --color-dark-grey: var(--dark-grey);
- --color-selected-color: var(--selected-color);
- --color-selected-color-dark: var(--selected-color-dark);
- --color-selected-bottom-dark: var(--selected-bottom-dark);
- --color-selected-bg-bottom-dark: var(--selected-bg-bottom-dark);
- --color-input-color: var(--input-color);
- }
- /* =========================================================
- * Base
- *
- * 只放:
- * - 全局 CSS variables
- * - html/body
- * - document-level defaults
- *
- * 不放具体业务组件样式。
- * ======================================================= */
- @layer base {
- :root {
- /* ---------- Theme ---------- */
- --background: #ffffff;
- --foreground: #000000;
- --selected-black: rgb(0 0 0 / 60%);
- --hero-background: #ffffff;
- --hero-foreground: #000000;
- --dark-grey: #404040;
- --selected-color: #e3ecff;
- --selected-color-dark: #555b69;
- --selected-bottom-dark: #95b6ff;
- --selected-bg-bottom-dark: #314779;
- --input-color: #b3b3b3;
- }
- /* ---------- Dark theme ---------- */
- .dark {
- --background: #171717;
- --foreground: #ffffff;
- --hero-background: #171717;
- --hero-foreground: #ffffff;
- }
- /* ---------- Document ---------- */
- html {
- /*--font-outfit-variable 是在根layout.tsx中定义的*/
- font-family:
- var(--font-outfit-variable),
- system-ui,
- sans-serif;
- /*
- * PC 项目推荐保留稳定 scrollbar gutter,
- * modal / drawer 锁定 body 时减少页面左右跳动。
- */
- scrollbar-gutter: stable;
- scrollbar-width: thin;
- scrollbar-color: #6b7280 transparent;
- }
- body {
- /*
- * PC 项目:
- * 保留你原来的最小页面宽度。
- *
- * 如果你的产品实际设计基准是 1024 / 1200,
- * 可以后续根据设计稿调整。
- */
- min-width: 768px;
- background-color: var(--background);
- color: var(--foreground);
- }
- }
- /* =========================================================
- * Components
- *
- * 放项目自己的复合样式和第三方组件 overrides。
- *
- * vendor.swiper 在 components 之前,因此这里的
- * Swiper override 不需要通过 !important 去抢优先级。
- * ======================================================= */
- @layer components {
- /* =======================================================
- * Scrollbar
- * ===================================================== */
- .drawer-scrollbar-hidden {
- scrollbar-width: none;
- }
- .drawer-scrollbar-hidden::-webkit-scrollbar {
- display: none;
- }
- /* =======================================================
- * Placeholder
- *
- * 兼容旧代码。
- *
- * 新代码优先考虑直接使用:
- * placeholder:text-input-color
- * dark:placeholder:text-selected-color-dark
- * ===================================================== */
- .placeholder-input-color::placeholder {
- color: var(--input-color);
- }
- .dark .placeholder-selected-color-dark::placeholder {
- color: var(--selected-color-dark);
- }
- /* =======================================================
- * Sticky heading
- * ===================================================== */
- .mobile-heading h2 {
- /*
- * bg-background 本身已经会跟随 --background,
- * 不需要:
- *
- * bg-white dark:bg-background
- */
- @apply sticky top-0 z-50 bg-background;
- }
- /* =======================================================
- * Scroll lock
- *
- * PC 项目不需要通过 position: fixed + 100vw
- * 处理 iOS Safari body scroll。
- *
- * scrollbar-gutter: stable 可以减少 scrollbar
- * 消失造成的页面横向跳动。
- * ===================================================== */
- .scroll-locked {
- overflow: hidden !important;
- }
- /* =======================================================
- * Disabled stroke
- * ===================================================== */
- .strokeline-bg-disabled {
- background-image:
- linear-gradient(
- to bottom right,
- transparent calc(50% - 1px),
- #acacac calc(50% - 1px),
- #acacac calc(50% + 1px),
- transparent calc(50% + 1px)
- );
- }
- /* =======================================================
- * Input
- * ===================================================== */
- .ly-input {
- @apply
- block
- h-14
- w-full
- box-border
- border
- border-ly-inputborder
- px-4
- text-ly-16
- leading-4
- placeholder:text-ly-placeholder
- focus:outline-none
- focus-visible:border-ly-green
- focus-visible:ring-2
- focus-visible:ring-ly-green/20;
- }
- /* =======================================================
- * Swiper overrides
- *
- * Swiper 原始 CSS:
- * vendor.swiper
- *
- * 项目 override:
- * components
- *
- * 所以这里无需 !important。
- * ===================================================== */
- .addtocartmodal-main-swiper .swiper-pagination-fraction {
- @apply
- absolute
- bottom-4
- left-1/2
- z-1
- flex
- h-6
- w-auto
- -translate-x-1/2
- items-center
- rounded-xl
- px-3
- text-ly-14
- bg-ly-deepgreen/50
- text-white;
- }
- /* =======================================================
- * Image
- * ===================================================== */
- .image-carousel-aspect {
- aspect-ratio: 1.72;
- }
- /* =======================================================
- * Animation
- * ===================================================== */
- .fade-in {
- animation: fade-in 0.3s ease-in-out forwards;
- }
- .fade-out {
- animation: fade-out 0.3s ease-in-out forwards;
- }
- .slide-bottom-in {
- animation: slide-bottom-in 0.3s ease-in-out forwards;
- }
- .slide-bottom-out {
- animation: slide-bottom-out 0.3s ease-in-out forwards;
- }
- @keyframes shimmer {
- from {
- transform: translateX(-100%);
- }
- to {
- transform: translateX(100%);
- }
- }
- @keyframes fade-in {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- @keyframes fade-out {
- from {
- opacity: 1;
- }
- to {
- opacity: 0;
- }
- }
- @keyframes slide-bottom-in {
- from {
- transform: translateY(100%);
- }
- to {
- transform: translateY(0);
- }
- }
- @keyframes slide-bottom-out {
- from {
- transform: translateY(0);
- }
- to {
- transform: translateY(100%);
- }
- }
- /* =======================================================
- * Project styles
- * ===================================================== */
- .ly-thin-shadow {
- box-shadow:
- 0 0 3px rgb(0 0 0 / 10%),
- 0 1px 2px rgb(0 0 0 / 6%);
- }
- .ly-vipplus-bg {
- background:
- linear-gradient(
- 128.05deg,
- rgb(250 231 200) 0%,
- rgb(249 255 235) 27.29%,
- rgb(242 215 172) 64.42%,
- rgb(232 202 153) 100%
- );
- }
- /* =======================================================
- * Apple Pay
- * ===================================================== */
- apple-pay-button {
- --apple-pay-button-box-sizing: border-box;
- --apple-pay-button-width: 300px;
- --apple-pay-button-height: 48px;
- --apple-pay-button-border-radius: 24px;
- --apple-pay-button-padding: 6px 0;
- display: block;
- width: 100%;
- }
- .middle-image-swiper.swiper-horizontal > .swiper-pagination-progressbar,
- .middle-image-swiper.swiper-horizontal .swiper-pagination-progressbar.swiper-pagination-horizontal{
- bottom: -16px ;
- top: unset;
- }
- }
|