global.css 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. @tailwind base;
  2. @tailwind components;
  3. @tailwind utilities;
  4. @layer base {
  5. *,
  6. ::after,
  7. ::before {
  8. @apply border-border;
  9. box-sizing: border-box;
  10. border-style: solid;
  11. border-width: 0;
  12. }
  13. html {
  14. @apply text-foreground bg-background font-sans text-[100%];
  15. font-variation-settings: normal;
  16. line-height: 1.15;
  17. text-size-adjust: 100%;
  18. font-synthesis-weight: none;
  19. scroll-behavior: smooth;
  20. text-rendering: optimizelegibility;
  21. -webkit-tap-highlight-color: transparent;
  22. }
  23. #app,
  24. body,
  25. html {
  26. @apply size-full overscroll-none;
  27. }
  28. body {
  29. min-height: 100vh;
  30. /* overflow: overlay; */
  31. -webkit-font-smoothing: antialiased;
  32. }
  33. a,
  34. a:active,
  35. a:hover,
  36. a:link,
  37. a:visited {
  38. @apply no-underline;
  39. }
  40. ::view-transition-new(root),
  41. ::view-transition-old(root) {
  42. @apply animate-none mix-blend-normal;
  43. }
  44. ::view-transition-old(root) {
  45. @apply z-[1];
  46. }
  47. ::view-transition-new(root) {
  48. @apply z-[2147483646];
  49. }
  50. html.dark::view-transition-old(root) {
  51. @apply z-[2147483646];
  52. }
  53. html.dark::view-transition-new(root) {
  54. @apply z-[1];
  55. }
  56. input::placeholder,
  57. textarea::placeholder {
  58. @apply opacity-100;
  59. }
  60. input:-webkit-autofill {
  61. @apply border-none;
  62. box-shadow: 0 0 0 1000px transparent inset;
  63. }
  64. input[type='number']::-webkit-inner-spin-button,
  65. input[type='number']::-webkit-outer-spin-button {
  66. @apply m-0 appearance-none;
  67. }
  68. /* 只有非mac下才进行调整,mac下使用默认滚动条 */
  69. html:not([data-platform='macOs']) {
  70. ::-webkit-scrollbar {
  71. @apply h-[1px] w-[10px];
  72. }
  73. ::-webkit-scrollbar-thumb {
  74. @apply bg-border rounded-sm border-none;
  75. }
  76. ::-webkit-scrollbar-track {
  77. @apply rounded-sm border-none bg-transparent shadow-none;
  78. }
  79. ::-webkit-scrollbar-button {
  80. @apply hidden;
  81. }
  82. }
  83. }
  84. @layer components {
  85. .flex-center {
  86. @apply flex items-center justify-center;
  87. }
  88. .flex-col-center {
  89. @apply flex flex-col items-center justify-center;
  90. }
  91. .outline-box {
  92. @apply outline-border relative cursor-pointer rounded-md p-1 outline outline-1;
  93. }
  94. .outline-box::after {
  95. @apply absolute left-1/2 top-1/2 z-20 h-0 w-[1px] rounded-sm opacity-0 outline outline-2 outline-transparent transition-all duration-300 content-[""];
  96. }
  97. .outline-box.outline-box-active {
  98. @apply outline-primary outline outline-2;
  99. }
  100. .outline-box.outline-box-active::after {
  101. display: none;
  102. }
  103. .outline-box:not(.outline-box-active):hover::after {
  104. @apply outline-primary left-0 top-0 h-full w-full p-1 opacity-100;
  105. }
  106. .card-box {
  107. @apply bg-card text-card-foreground border-border rounded-xl border shadow;
  108. }
  109. }
  110. html.invert-mode {
  111. @apply invert;
  112. }
  113. html.grayscale-mode {
  114. @apply grayscale;
  115. }