|
1 | 1 | @import "tailwindcss"; |
2 | | -@import "tw-animate-css"; |
3 | | - |
4 | | -@custom-variant dark (&:is(.dark *)); |
5 | 2 |
|
6 | | -@theme inline { |
7 | | - --radius-sm: calc(var(--radius) - 4px); |
8 | | - --radius-md: calc(var(--radius) - 2px); |
9 | | - --radius-lg: var(--radius); |
10 | | - --radius-xl: calc(var(--radius) + 4px); |
11 | | - --color-background: var(--background); |
12 | | - --color-foreground: var(--foreground); |
13 | | - --color-card: var(--card); |
14 | | - --color-card-foreground: var(--card-foreground); |
15 | | - --color-popover: var(--popover); |
16 | | - --color-popover-foreground: var(--popover-foreground); |
17 | | - --color-primary: var(--primary); |
18 | | - --color-primary-foreground: var(--primary-foreground); |
19 | | - --color-secondary: var(--secondary); |
20 | | - --color-secondary-foreground: var(--secondary-foreground); |
21 | | - --color-muted: var(--muted); |
22 | | - --color-muted-foreground: var(--muted-foreground); |
23 | | - --color-accent: var(--accent); |
24 | | - --color-accent-foreground: var(--accent-foreground); |
25 | | - --color-destructive: var(--destructive); |
26 | | - --color-border: var(--border); |
27 | | - --color-input: var(--input); |
28 | | - --color-ring: var(--ring); |
29 | | - --color-chart-1: var(--chart-1); |
30 | | - --color-chart-2: var(--chart-2); |
31 | | - --color-chart-3: var(--chart-3); |
32 | | - --color-chart-4: var(--chart-4); |
33 | | - --color-chart-5: var(--chart-5); |
34 | | - --color-sidebar: var(--sidebar); |
35 | | - --color-sidebar-foreground: var(--sidebar-foreground); |
36 | | - --color-sidebar-primary: var(--sidebar-primary); |
37 | | - --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); |
38 | | - --color-sidebar-accent: var(--sidebar-accent); |
39 | | - --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); |
40 | | - --color-sidebar-border: var(--sidebar-border); |
41 | | - --color-sidebar-ring: var(--sidebar-ring); |
42 | | -} |
43 | | - |
44 | | -:root { |
45 | | - --radius: 0.65rem; |
46 | | - --background: oklch(1 0 0); |
47 | | - --foreground: oklch(0.141 0.005 285.823); |
48 | | - --card: oklch(1 0 0); |
49 | | - --card-foreground: oklch(0.141 0.005 285.823); |
50 | | - --popover: oklch(1 0 0); |
51 | | - --popover-foreground: oklch(0.141 0.005 285.823); |
52 | | - --primary: oklch(0.541 0.281 293.009); |
53 | | - --primary-foreground: oklch(0.969 0.016 293.756); |
54 | | - --secondary: oklch(0.967 0.001 286.375); |
55 | | - --secondary-foreground: oklch(0.21 0.006 285.885); |
56 | | - --muted: oklch(0.967 0.001 286.375); |
57 | | - --muted-foreground: oklch(0.552 0.016 285.938); |
58 | | - --accent: oklch(0.967 0.001 286.375); |
59 | | - --accent-foreground: oklch(0.21 0.006 285.885); |
60 | | - --destructive: oklch(0.577 0.245 27.325); |
61 | | - --border: oklch(0.92 0.004 286.32); |
62 | | - --input: oklch(0.92 0.004 286.32); |
63 | | - --ring: oklch(0.702 0.183 293.541); |
64 | | - --chart-1: oklch(0.811 0.111 293.571); |
65 | | - --chart-2: oklch(0.606 0.25 292.717); |
66 | | - --chart-3: oklch(0.541 0.281 293.009); |
67 | | - --chart-4: oklch(0.491 0.27 292.581); |
68 | | - --chart-5: oklch(0.432 0.232 292.759); |
69 | | - --sidebar: oklch(0.985 0 0); |
70 | | - --sidebar-foreground: oklch(0.141 0.005 285.823); |
71 | | - --sidebar-primary: oklch(0.541 0.281 293.009); |
72 | | - --sidebar-primary-foreground: oklch(0.969 0.016 293.756); |
73 | | - --sidebar-accent: oklch(0.967 0.001 286.375); |
74 | | - --sidebar-accent-foreground: oklch(0.21 0.006 285.885); |
75 | | - --sidebar-border: oklch(0.92 0.004 286.32); |
76 | | - --sidebar-ring: oklch(0.702 0.183 293.541); |
77 | | -} |
| 3 | +/* * NOTE on @custom-variant and tw-animate-css: |
| 4 | + * Tailwind CSS v4 focuses on a standard CSS workflow. |
| 5 | + * If 'tw-animate-css' and '@custom-variant' are needed, |
| 6 | + * you must ensure they are supported by your specific PostCSS setup. |
| 7 | + * For standard v4, you'd usually define the dark mode class in your config. |
| 8 | + * * Assuming 'tw-animate-css' is a necessary plugin/import: |
| 9 | + */ |
| 10 | +@import "tw-animate-css"; |
78 | 11 |
|
79 | | -.dark { |
80 | | - --background: oklch(0.141 0.005 285.823); |
81 | | - --foreground: oklch(0.985 0 0); |
82 | | - --card: oklch(0.21 0.006 285.885); |
83 | | - --card-foreground: oklch(0.985 0 0); |
84 | | - --popover: oklch(0.21 0.006 285.885); |
85 | | - --popover-foreground: oklch(0.985 0 0); |
86 | | - --primary: oklch(0.606 0.25 292.717); |
87 | | - --primary-foreground: oklch(0.969 0.016 293.756); |
88 | | - --secondary: oklch(0.274 0.006 286.033); |
89 | | - --secondary-foreground: oklch(0.985 0 0); |
90 | | - --muted: oklch(0.274 0.006 286.033); |
91 | | - --muted-foreground: oklch(0.705 0.015 286.067); |
92 | | - --accent: oklch(0.274 0.006 286.033); |
93 | | - --accent-foreground: oklch(0.985 0 0); |
94 | | - --destructive: oklch(0.704 0.191 22.216); |
95 | | - --border: oklch(1 0 0 / 10%); |
96 | | - --input: oklch(1 0 0 / 15%); |
97 | | - --ring: oklch(0.38 0.189 293.745); |
98 | | - --chart-1: oklch(0.811 0.111 293.571); |
99 | | - --chart-2: oklch(0.606 0.25 292.717); |
100 | | - --chart-3: oklch(0.541 0.281 293.009); |
101 | | - --chart-4: oklch(0.491 0.27 292.581); |
102 | | - --chart-5: oklch(0.432 0.232 292.759); |
103 | | - --sidebar: oklch(0.21 0.006 285.885); |
104 | | - --sidebar-foreground: oklch(0.985 0 0); |
105 | | - --sidebar-primary: oklch(0.606 0.25 292.717); |
106 | | - --sidebar-primary-foreground: oklch(0.969 0.016 293.756); |
107 | | - --sidebar-accent: oklch(0.274 0.006 286.033); |
108 | | - --sidebar-accent-foreground: oklch(0.985 0 0); |
109 | | - --sidebar-border: oklch(1 0 0 / 10%); |
110 | | - --sidebar-ring: oklch(0.38 0.189 293.745); |
| 12 | +/* * V4 Recommendation: Define the dark variant directly in your tailwind.config.js |
| 13 | + * if possible (e.g., darkMode: ['class', '.dark']). |
| 14 | + * If you must define a custom variant here, the syntax is correct for PostCSS/Tailwind: |
| 15 | + */ |
| 16 | +@custom-variant dark { |
| 17 | + :is(.dark &) ; |
111 | 18 | } |
112 | 19 |
|
113 | 20 | @layer base { |
| 21 | + /* Global reset for border color. */ |
114 | 22 | * { |
115 | | - @apply border-border outline-ring/50; |
| 23 | + border-color: hsl(var(--border)); |
| 24 | + /* Improved focus state for accessibility */ |
| 25 | + &:focus-visible { |
| 26 | + outline-color: hsl(var(--ring)); |
| 27 | + outline: 2px solid; |
| 28 | + outline-offset: 2px; |
| 29 | + } |
116 | 30 | } |
| 31 | + |
| 32 | + /* Correct placement of body selector, sibling to * */ |
117 | 33 | body { |
118 | | - @apply bg-background text-foreground; |
| 34 | + background-color: hsl(var(--background)); |
| 35 | + color: hsl(var(--foreground)); |
| 36 | + } |
| 37 | + |
| 38 | + /* ---------------------- ☀️ Light Theme (:root) ---------------------- */ |
| 39 | + :root { |
| 40 | + /* Base Colors */ |
| 41 | + --background: 0 0% 100%; |
| 42 | + --foreground: 222.2 84% 4.9%; |
| 43 | + --card: 0 0% 100%; |
| 44 | + --card-foreground: 222.2 84% 4.9%; |
| 45 | + --popover: 0 0% 100%; |
| 46 | + --popover-foreground: 222.2 84% 4.9%; |
| 47 | + |
| 48 | + /* Primary / Secondary / Functional */ |
| 49 | + --primary: 221.2 83.2% 53.3%; |
| 50 | + --primary-foreground: 210 40% 98%; |
| 51 | + --secondary: 210 40% 96.1%; |
| 52 | + --secondary-foreground: 222.2 47.4% 11.2%; |
| 53 | + --muted: 210 40% 96.1%; |
| 54 | + --muted-foreground: 215.4 16.3% 46.9%; |
| 55 | + --accent: 210 40% 96.1%; |
| 56 | + --accent-foreground: 222.2 47.4% 11.2%; |
| 57 | + --destructive: 0 84.2% 60.2%; |
| 58 | + --destructive-foreground: 210 40% 98%; |
| 59 | + |
| 60 | + /* Borders & Interaction */ |
| 61 | + --border: 214.3 31.8% 91.4%; |
| 62 | + --input: 214.3 31.8% 91.4%; |
| 63 | + --ring: 221.2 83.2% 53.3%; |
| 64 | + |
| 65 | + /* Radius */ |
| 66 | + --radius: 0.5rem; |
| 67 | + --radius-sm: calc(var(--radius) - 4px); |
| 68 | + --radius-md: calc(var(--radius) - 2px); |
| 69 | + --radius-lg: var(--radius); |
| 70 | + --radius-xl: calc(var(--radius) + 4px); |
| 71 | + |
| 72 | + /* Chart Colors */ |
| 73 | + --chart-1: 12 76% 61%; |
| 74 | + --chart-2: 173 58% 39%; |
| 75 | + --chart-3: 197 37% 24%; |
| 76 | + --chart-4: 43 74% 66%; |
| 77 | + --chart-5: 27 87% 67%; |
| 78 | + |
| 79 | + /* Sidebar Variables (Simplified to reference existing colors) */ |
| 80 | + --sidebar: var(--background); |
| 81 | + --sidebar-foreground: var(--foreground); |
| 82 | + --sidebar-primary: var(--primary); |
| 83 | + --sidebar-primary-foreground: var(--primary-foreground); |
| 84 | + --sidebar-accent: var(--accent); |
| 85 | + --sidebar-accent-foreground: var(--accent-foreground); |
| 86 | + --sidebar-border: var(--border); |
| 87 | + --sidebar-ring: var(--ring); |
| 88 | + } |
| 89 | + |
| 90 | + /* ---------------------- 🌙 Dark Theme (.dark) ---------------------- */ |
| 91 | + .dark { |
| 92 | + /* Base Colors */ |
| 93 | + --background: 222.2 84% 4.9%; |
| 94 | + --foreground: 210 40% 98%; |
| 95 | + --card: 222.2 84% 4.9%; |
| 96 | + --card-foreground: 210 40% 98%; |
| 97 | + --popover: 222.2 84% 4.9%; |
| 98 | + --popover-foreground: 210 40% 98%; |
| 99 | + |
| 100 | + /* Primary / Secondary / Functional */ |
| 101 | + --primary: 217.2 91.2% 59.8%; |
| 102 | + --primary-foreground: 222.2 47.4% 11.2%; |
| 103 | + --secondary: 217.2 32.6% 17.5%; |
| 104 | + --secondary-foreground: 210 40% 98%; |
| 105 | + --muted: 217.2 32.6% 17.5%; |
| 106 | + --muted-foreground: 215 20.2% 65.1%; |
| 107 | + --accent: 217.2 32.6% 17.5%; |
| 108 | + --accent-foreground: 210 40% 98%; |
| 109 | + --destructive: 0 62.8% 30.6%; |
| 110 | + --destructive-foreground: 210 40% 98%; |
| 111 | + |
| 112 | + /* Borders & Interaction */ |
| 113 | + --border: 217.2 32.6% 17.5%; |
| 114 | + --input: 217.2 32.6% 17.5%; |
| 115 | + --ring: 224.3 76.3% 48%; |
| 116 | + |
| 117 | + /* Chart Colors */ |
| 118 | + --chart-1: 220 70% 50%; |
| 119 | + --chart-2: 160 60% 45%; |
| 120 | + --chart-3: 30 80% 55%; |
| 121 | + --chart-4: 280 65% 60%; |
| 122 | + --chart-5: 340 75% 55%; |
| 123 | + |
| 124 | + /* Sidebar variables will inherit from the dark base colors defined here. */ |
119 | 125 | } |
120 | 126 | } |
0 commit comments