globals.css 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. @import "tailwindcss";
  2. @plugin '../../hero.ts';
  3. @source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
  4. @custom-variant dark (&:is(.dark *));
  5. html,
  6. body {
  7. scrollbar-width: thin;
  8. scrollbar-color: #6b7280 transparent;
  9. }
  10. html::-webkit-scrollbar,
  11. body::-webkit-scrollbar {
  12. width: 6px;
  13. height: 6px;
  14. }
  15. html::-webkit-scrollbar-track,
  16. body::-webkit-scrollbar-track {
  17. background: transparent;
  18. }
  19. html::-webkit-scrollbar-thumb,
  20. body::-webkit-scrollbar-thumb {
  21. background-color: #6b7280;
  22. border-radius: 9999px;
  23. }
  24. .dark html::-webkit-scrollbar-thumb,
  25. .dark body::-webkit-scrollbar-thumb {
  26. background-color: #d4d4d4;
  27. }
  28. /**
  29. * 移动端适配核心:clamp() 根字号 在390px设计稿下 16px ≈ 4.1025641vw = 1rem
  30. * 比如 390px设计稿,有一个div宽度是120px,那么可以写 w-30,下面是换算原理:
  31. * tailwindcss中单位用的是rem, 默认根字号为16px,也就是在tailwindcss中,0.25rem = 4px,
  32. * 而对于类名 w-1 来说,这里的1就是0.25rem,即4px,那么w-1就是4px,w-2就是8px,以此类推
  33. *
  34. * */
  35. html {
  36. font-size: clamp(10px, 4.1025641vw, 40px);
  37. }
  38. /* GLOBAL VARIABLES :root中定义常规变量,不被映射到工具类*/
  39. :root {
  40. /* Font families */
  41. font-family: var(--font-outfit), system-ui, sans-serif;
  42. --background: #ffffff;
  43. --foreground: #000;
  44. --color-selected-black: #00000099;
  45. --hero-background: #ffffff;
  46. --hero-foreground: #000;
  47. --dark-grey: #404040;
  48. --selected-color: #e3ecff;
  49. --selected-color-dark: #555b69;
  50. --selected-bottom-dark: #95b6ff;
  51. --selected-bg-bottom-dark: #314779;
  52. --input-color: #b3b3b3;
  53. /* 字体尺寸 */
  54. --font-size-xxs: 13px;
  55. /* 间距变量(供自定义类使用) */
  56. --space-30: 120px;
  57. --space-7_5: 30px;
  58. --space-92_5: 23.125rem;
  59. }
  60. /*theme中定义的变量可以被映射到实用程序类(需要注意映射规则,不是所有变量都能映射)*/
  61. @theme {
  62. /* 仅保留字体族定义,其他通过 :root 变量注入 */
  63. --font-family-outfit: var(--font-outfit), system-ui, sans-serif;
  64. /*自定义颜色*/
  65. --color-ly-lightgray: #f2f2f2;
  66. --color-ly-gray: #d3d3d3; /*可被映射为text-ly-gray,bg-ly-gray等相关的颜色类目*/
  67. --color-ly-gold: #ffd700;
  68. --color-ly-green: #01754a;
  69. --color-ly-middlegreen: #036141;
  70. --color-ly-deepgreen: #1e3932;
  71. /*自定义字体大小 前缀 ly*/
  72. --text-ly-12: 0.75rem;
  73. --text-ly-14: 0.875rem;
  74. --text-ly-16: 1rem;
  75. --text-ly-18: 1.125rem;
  76. --text-ly-20: 1.25rem;
  77. --text-ly-22: 1.375rem;
  78. --text-ly-24: 1.5rem;
  79. --text-ly-30: 1.875rem; /* 1.875rem (30px) */
  80. --text-ly-36: 2.25rem; /* 2.25rem (36px) */
  81. --text-ly-48: 3rem; /* 3rem (48px) */
  82. /*自定义行高 前缀 ly*/
  83. --leading-ly-16: 1rem;
  84. --leading-ly-18: 1.125rem;
  85. --leading-ly-20: 1.25rem;
  86. --leading-ly-22: 1.375rem;
  87. --leading-ly-24: 1.5rem;
  88. --leading-ly-26: 1.625rem;
  89. --leading-ly-28: 1.75rem;
  90. --leading-ly-36: 2.25rem;
  91. }
  92. @utility h-ly-46 {
  93. height: 2.875rem;
  94. }
  95. @utility strokeline-bg-disabled {
  96. background-image:linear-gradient(to bottom right,transparent,transparent calc(50% - 1px),#acacac 50%,#acacac 0,transparent calc(50% + 1px));
  97. }
  98. .dark {
  99. --background: #171717;
  100. --foreground: #ffffff;
  101. --hero-background: #171717;
  102. --hero-foreground: #ffffff;
  103. }
  104. @theme inline {
  105. --color-background: var(--background);
  106. --color-foreground: var(--foreground);
  107. --color-font-color: var(--font-color);
  108. --color-selected-black: var(--color-selected-black);
  109. --color-dark-grey: var(--dark-grey);
  110. --color-selected-color: var(--selected-color);
  111. --color-selected-color-dark: var(--selected-color-dark);
  112. --color-selected-bottom-dark: var(--selected-bottom-dark);
  113. --color-selected-bg-bottom-dark: var(--selected-bg-bottom-dark);
  114. --color-input-color: var(--input-color);
  115. }
  116. body {
  117. background: var(--background);
  118. color: var(--foreground);
  119. font-family: var(--font-outfit), system-ui, sans-serif;
  120. }
  121. @layer components {
  122. /* Hide scrollbar for drawer content */
  123. .drawer-scrollbar-hidden {
  124. scrollbar-width: none;
  125. -ms-overflow-style: none;
  126. }
  127. .drawer-scrollbar-hidden::-webkit-scrollbar {
  128. display: none;
  129. }
  130. .placeholder-input-color::placeholder {
  131. color: var(--input-color);
  132. }
  133. .dark .placeholder-selected-color-dark::placeholder {
  134. color: var(--selected-color-dark);
  135. }
  136. .mobile-heading h2 {
  137. @apply sticky bg-white z-50 dark:bg-background top-0;
  138. }
  139. .prose h1 {
  140. margin: 12px 0 !important;
  141. font-family: Outfit, sans-serif !important;
  142. font-size: 24px !important;
  143. font-weight: 600 !important;
  144. }
  145. .prose p {
  146. color: var(--color-selected-black) !important;
  147. font-weight: 300 !important;
  148. }
  149. .dark .prose p {
  150. color: white !important;
  151. font-weight: 300 !important;
  152. }
  153. .margin-t {
  154. margin-top: -9px;
  155. }
  156. @keyframes shimmer {
  157. 0% {
  158. transform: translateX(-100%);
  159. }
  160. 100% {
  161. transform: translateX(100%);
  162. }
  163. }
  164. .image-carousel-aspect {
  165. aspect-ratio: 1.72;
  166. }
  167. /* Prevent body scrolling when drawer is open */
  168. .scroll-locked {
  169. overflow: hidden !important;
  170. height: 100vh !important;
  171. width: 100vw !important;
  172. position: fixed !important;
  173. top: 0;
  174. left: 0;
  175. touch-action: none;
  176. -webkit-overflow-scrolling: none;
  177. }
  178. }