/* ========================================================= * 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 按需引入 * ======================================================= */ @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 { /*自定义颜色*/ --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; /*自定义字体大小 前缀 ly*/ --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; /*自定义行高 前缀 ly*/ --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。 * @theme指令中的 inline 表示定义引用其他变量的主题变量, 比如 定义了一个变量--color-background,--color-background引用的是另一个变量 * 例如: * * --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); /*placeholder:text-input-color 设置placeholder颜色*/ } /* ========================================================= * Base * * 只放: * - 全局 CSS variables * - html/body * - document-level defaults * * 不放具体业务组件样式。 * ======================================================= */ @layer base { :root { /* GLOBAL VARIABLES :root中定义常规变量,不被映射到工具类*/ --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; /** * 移动端适配核心:clamp() 根字号 在390px设计稿下 16px ≈ 4.1025641vw = 1rem * 比如 390px设计稿,有一个div宽度是120px,那么可以写 w-30,下面是换算原理: * tailwindcss中单位用的是rem, 默认根字号为16px,也就是在tailwindcss中,0.25rem = 4px, * 而对于类名 w-1 来说,这里的1就是0.25rem,即4px,那么w-1就是4px,w-2就是8px,以此类推 * * */ font-size: clamp(10px, 4.1025641vw, 40px); } body { background-color: var(--background); color: var(--foreground); } } /* ========================================================= * Components * * 放项目自己的复合样式和第三方组件 overrides。 * * vendor.swiper 在 components 之前,因此这里的 * Swiper override 不需要通过 !important 去抢优先级。 * ======================================================= */ @layer components { /* Hide scrollbar for drawer content */ .drawer-scrollbar-hidden { scrollbar-width: none; } .drawer-scrollbar-hidden::-webkit-scrollbar { display: none; } .mobile-heading h2 { @apply sticky z-50 bg-background top-0; } @keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } } .image-carousel-aspect { aspect-ratio: 1.72; } /* Prevent body scrolling when drawer is open */ .scroll-locked { overflow: hidden !important; height: 100vh !important; width: 100vw !important; position: fixed !important; top: 0; left: 0; touch-action: none; -webkit-overflow-scrolling: none; } /*禁用按钮样式*/ .strokeline-bg-disabled { background-image:linear-gradient(to bottom right,transparent,transparent calc(50% - 1px),#acacac 50%,#acacac 0,transparent calc(50% + 1px)); } /*输入框样式*/ .ly-input{ @apply block w-full box-border text-ly-12 px-4 leading-4 border-1 border-ly-inputborder h-11.5 placeholder:text-ly-placeholder focus:outline-none; } .middle-image-swiper.swiper-horizontal > .swiper-pagination-progressbar, .middle-image-swiper .swiper-pagination-progressbar.swiper-pagination-horizontal{ bottom: -1rem ; top: unset; } .fade-in{ animation: fade-in 0.3s ease-in-out forwards; } .fade-out{ animation: fade-out 0.3s ease-in-out forwards; } @keyframes fade-in{ 0%{ opacity: 0; } 100%{ opacity: 1; } } @keyframes fade-out{ 0%{ opacity: 1; } 100%{ opacity: 0; } } .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 slide-bottom-in{ 0%{ transform: translateY(100%); } 100%{ transform: translateY(0); } } @keyframes slide-bottom-out{ 0%{ transform: translateY(0%); } 100%{ transform: translateY(100%); } } .ly-thin-shadow{ box-shadow: 0 0px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); } .ly-vipplus-bg{ background: linear-gradient(128.05deg, rgba(250, 231, 200, 1) 0%, rgba(249, 255, 235, 1) 27.29%, rgba(242, 215, 172, 1) 64.42%, rgba(232, 202, 153, 1) 100%); } 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 0px; display: block; width: 100%; } }