globals.css 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. /* =========================================================
  2. * Cascade layer order
  3. *
  4. * theme
  5. * ↓
  6. * base
  7. * ↓
  8. * vendor.swiper
  9. * ↓
  10. * components
  11. * ↓
  12. * utilities
  13. * ======================================================= */
  14. @layer theme, base, vendor, components, utilities;
  15. @layer vendor.swiper;
  16. /* =========================================================
  17. * Framework / vendor imports
  18. *
  19. * 注意:
  20. * @import 必须位于普通 CSS rule 之前。
  21. * Swiper 按需引入
  22. * ======================================================= */
  23. @import "tailwindcss";
  24. @import "swiper/css" layer(vendor.swiper);
  25. @import "swiper/css/navigation" layer(vendor.swiper);
  26. @import "swiper/css/pagination" layer(vendor.swiper);
  27. @import 'swiper/css/free-mode' layer(vendor.swiper);
  28. @import 'swiper/css/thumbs' layer(vendor.swiper);
  29. /* =========================================================
  30. * HeroUI v2
  31. * ======================================================= */
  32. @plugin '../../hero.ts';
  33. @source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
  34. @custom-variant dark (&:is(.dark *));
  35. @import "../assets/styles/cms-content.css" layer(components);
  36. /* =========================================================
  37. * Tailwind theme tokens
  38. *
  39. * @theme 中的变量会映射到 Tailwind utilities。
  40. *
  41. * 例如:
  42. * --color-ly-gray
  43. * → text-ly-gray
  44. * → bg-ly-gray
  45. * → border-ly-gray
  46. *
  47. * --text-ly-16
  48. * → text-ly-16
  49. *
  50. * --leading-ly-24
  51. * → leading-ly-24
  52. * ======================================================= */
  53. @theme {
  54. /*自定义颜色*/
  55. --color-ly-inputborder: #e5e5e5;
  56. --color-ly-placeholder: #A6A6A6;
  57. --color-ly-errorcolor: #FF0000;
  58. --color-ly-lightgray: #f9f9f9;
  59. --color-ly-middlegray: #f2f2f2;
  60. --color-ly-gray: #d3d3d3;
  61. --color-ly-deepgray: #ACACAC;
  62. --color-ly-gold: #ffd700;
  63. --color-ly-green: #01754a;
  64. --color-ly-middlegreen: #036141;
  65. --color-ly-deepgreen: #1e3932;
  66. /*自定义字体大小 前缀 ly*/
  67. --text-ly-12: 0.75rem;
  68. --text-ly-13: 0.8125rem;
  69. --text-ly-14: 0.875rem;
  70. --text-ly-16: 1rem;
  71. --text-ly-18: 1.125rem;
  72. --text-ly-20: 1.25rem;
  73. --text-ly-22: 1.375rem;
  74. --text-ly-24: 1.5rem;
  75. --text-ly-30: 1.875rem;
  76. --text-ly-36: 2.25rem;
  77. --text-ly-48: 3rem;
  78. /*自定义行高 前缀 ly*/
  79. --leading-ly-16: 1rem;
  80. --leading-ly-18: 1.125rem;
  81. --leading-ly-20: 1.25rem;
  82. --leading-ly-22: 1.375rem;
  83. --leading-ly-24: 1.5rem;
  84. --leading-ly-26: 1.625rem;
  85. --leading-ly-28: 1.75rem;
  86. --leading-ly-36: 2.25rem;
  87. }
  88. /* =========================================================
  89. * Runtime variables -> Tailwind theme
  90. *
  91. * inline 用于引用其它 CSS variables。
  92. * @theme指令中的 inline 表示定义引用其他变量的主题变量, 比如 定义了一个变量--color-background,--color-background引用的是另一个变量
  93. * 例如:
  94. *
  95. * --background
  96. * ↓
  97. * --color-background
  98. * ↓
  99. * bg-background
  100. *
  101. * 当 .dark 修改 --background 后,
  102. * bg-background 会自动跟随,不需要额外写:
  103. *
  104. * bg-white dark:bg-background
  105. * ======================================================= */
  106. @theme inline {
  107. --font-outfit:
  108. var(--font-outfit-variable),
  109. system-ui,
  110. sans-serif;
  111. --color-background: var(--background);
  112. --color-foreground: var(--foreground);
  113. --color-selected-black: var(--selected-black);
  114. --color-dark-grey: var(--dark-grey);
  115. --color-selected-color: var(--selected-color);
  116. --color-selected-color-dark: var(--selected-color-dark);
  117. --color-selected-bottom-dark: var(--selected-bottom-dark);
  118. --color-selected-bg-bottom-dark: var(--selected-bg-bottom-dark);
  119. --color-input-color: var(--input-color); /*placeholder:text-input-color 设置placeholder颜色*/
  120. }
  121. /* =========================================================
  122. * Base
  123. *
  124. * 只放:
  125. * - 全局 CSS variables
  126. * - html/body
  127. * - document-level defaults
  128. *
  129. * 不放具体业务组件样式。
  130. * ======================================================= */
  131. @layer base {
  132. :root {
  133. /* GLOBAL VARIABLES :root中定义常规变量,不被映射到工具类*/
  134. --background: #ffffff;
  135. --foreground: #000000;
  136. --selected-black: rgb(0 0 0 / 60%);
  137. --hero-background: #ffffff;
  138. --hero-foreground: #000000;
  139. --dark-grey: #404040;
  140. --selected-color: #e3ecff;
  141. --selected-color-dark: #555b69;
  142. --selected-bottom-dark: #95b6ff;
  143. --selected-bg-bottom-dark: #314779;
  144. --input-color: #b3b3b3;
  145. }
  146. /* ---------- Dark theme ---------- */
  147. .dark {
  148. --background: #171717;
  149. --foreground: #ffffff;
  150. --hero-background: #171717;
  151. --hero-foreground: #ffffff;
  152. }
  153. /* ---------- Document ---------- */
  154. html {
  155. /*--font-outfit-variable 是在根layout.tsx中定义的*/
  156. font-family:
  157. var(--font-outfit-variable),
  158. system-ui,
  159. sans-serif;
  160. /*
  161. * PC 项目推荐保留稳定 scrollbar gutter,
  162. * modal / drawer 锁定 body 时减少页面左右跳动。
  163. */
  164. scrollbar-gutter: stable;
  165. scrollbar-width: thin;
  166. scrollbar-color: #6b7280 transparent;
  167. /**
  168. * 移动端适配核心:clamp() 根字号 在390px设计稿下 16px ≈ 4.1025641vw = 1rem
  169. * 比如 390px设计稿,有一个div宽度是120px,那么可以写 w-30,下面是换算原理:
  170. * tailwindcss中单位用的是rem, 默认根字号为16px,也就是在tailwindcss中,0.25rem = 4px,
  171. * 而对于类名 w-1 来说,这里的1就是0.25rem,即4px,那么w-1就是4px,w-2就是8px,以此类推
  172. *
  173. * */
  174. font-size: clamp(10px, 4.1025641vw, 40px);
  175. }
  176. body {
  177. background-color: var(--background);
  178. color: var(--foreground);
  179. }
  180. }
  181. /* =========================================================
  182. * Components
  183. *
  184. * 放项目自己的复合样式和第三方组件 overrides。
  185. *
  186. * vendor.swiper 在 components 之前,因此这里的
  187. * Swiper override 不需要通过 !important 去抢优先级。
  188. * ======================================================= */
  189. @layer components {
  190. /* Hide scrollbar for drawer content */
  191. .drawer-scrollbar-hidden {
  192. scrollbar-width: none;
  193. }
  194. .drawer-scrollbar-hidden::-webkit-scrollbar {
  195. display: none;
  196. }
  197. .mobile-heading h2 {
  198. @apply sticky z-50 bg-background top-0;
  199. }
  200. @keyframes shimmer {
  201. 0% {
  202. transform: translateX(-100%);
  203. }
  204. 100% {
  205. transform: translateX(100%);
  206. }
  207. }
  208. .image-carousel-aspect {
  209. aspect-ratio: 1.72;
  210. }
  211. /* Prevent body scrolling when drawer is open */
  212. .scroll-locked {
  213. overflow: hidden !important;
  214. height: 100vh !important;
  215. width: 100vw !important;
  216. position: fixed !important;
  217. top: 0;
  218. left: 0;
  219. touch-action: none;
  220. -webkit-overflow-scrolling: none;
  221. }
  222. /*禁用按钮样式*/
  223. .strokeline-bg-disabled {
  224. background-image:linear-gradient(to bottom right,transparent,transparent calc(50% - 1px),#acacac 50%,#acacac 0,transparent calc(50% + 1px));
  225. }
  226. /*输入框样式*/
  227. .ly-input{
  228. @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;
  229. }
  230. .middle-image-swiper.swiper-horizontal > .swiper-pagination-progressbar,
  231. .middle-image-swiper .swiper-pagination-progressbar.swiper-pagination-horizontal{
  232. bottom: -1rem ;
  233. top: unset;
  234. }
  235. .fade-in{
  236. animation: fade-in 0.3s ease-in-out forwards;
  237. }
  238. .fade-out{
  239. animation: fade-out 0.3s ease-in-out forwards;
  240. }
  241. @keyframes fade-in{
  242. 0%{
  243. opacity: 0;
  244. }
  245. 100%{
  246. opacity: 1;
  247. }
  248. }
  249. @keyframes fade-out{
  250. 0%{
  251. opacity: 1;
  252. }
  253. 100%{
  254. opacity: 0;
  255. }
  256. }
  257. .slide-bottom-in{
  258. animation: slide-bottom-in 0.3s ease-in-out forwards;
  259. }
  260. .slide-bottom-out{
  261. animation: slide-bottom-out 0.3s ease-in-out forwards;
  262. }
  263. @keyframes slide-bottom-in{
  264. 0%{
  265. transform: translateY(100%);
  266. }
  267. 100%{
  268. transform: translateY(0);
  269. }
  270. }
  271. @keyframes slide-bottom-out{
  272. 0%{
  273. transform: translateY(0%);
  274. }
  275. 100%{
  276. transform: translateY(100%);
  277. }
  278. }
  279. .ly-thin-shadow{
  280. box-shadow: 0 0px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  281. }
  282. .ly-vipplus-bg{
  283. 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%);
  284. }
  285. apple-pay-button {
  286. --apple-pay-button-box-sizing: border-box;
  287. --apple-pay-button-width: 300px;
  288. --apple-pay-button-height: 48px;
  289. --apple-pay-button-border-radius: 24px;
  290. --apple-pay-button-padding: 6px 0px;
  291. display: block;
  292. width: 100%;
  293. }
  294. }