Skip to content

Commit 5e82ea7

Browse files
committed
fix: Convert to Tailwind v4 @theme syntax for color utilities
- Replaced @tailwind directives with @import "tailwindcss" - Converted :root CSS variables to @theme block with --color-* naming - This generates utility classes like .bg-primary, .text-foreground, etc. - CSS bundle increased from 6.21KB to 18.54KB (all color utilities now present) - Fixes broken UI where custom colors weren't being applied
1 parent f1187ea commit 5e82ea7

File tree

1 file changed

+33
-34
lines changed

1 file changed

+33
-34
lines changed

AIGovHub/frontend/src/index.css

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import "tailwindcss";
42

5-
@layer base {
6-
:root {
7-
--background: 0 0% 100%;
8-
--foreground: 222.2 84% 4.9%;
9-
--card: 0 0% 100%;
10-
--card-foreground: 222.2 84% 4.9%;
11-
--popover: 0 0% 100%;
12-
--popover-foreground: 222.2 84% 4.9%;
13-
--primary: 221.2 83.2% 53.3%;
14-
--primary-foreground: 210 40% 98%;
15-
--secondary: 210 40% 96.1%;
16-
--secondary-foreground: 222.2 47.4% 11.2%;
17-
--muted: 210 40% 96.1%;
18-
--muted-foreground: 215.4 16.3% 46.9%;
19-
--accent: 210 40% 96.1%;
20-
--accent-foreground: 222.2 47.4% 11.2%;
21-
--destructive: 0 84.2% 60.2%;
22-
--destructive-foreground: 210 40% 98%;
23-
--border: 214.3 31.8% 91.4%;
24-
--input: 214.3 31.8% 91.4%;
25-
--ring: 221.2 83.2% 53.3%;
26-
--radius: 0.5rem;
27-
--chart-1: 12 76% 61%;
28-
--chart-2: 173 58% 39%;
29-
--chart-3: 197 37% 24%;
30-
--chart-4: 43 74% 66%;
31-
--chart-5: 27 87% 67%;
32-
}
3+
@theme {
4+
--color-background: hsl(0 0% 100%);
5+
--color-foreground: hsl(222.2 84% 4.9%);
6+
--color-card: hsl(0 0% 100%);
7+
--color-card-foreground: hsl(222.2 84% 4.9%);
8+
--color-popover: hsl(0 0% 100%);
9+
--color-popover-foreground: hsl(222.2 84% 4.9%);
10+
--color-primary: hsl(221.2 83.2% 53.3%);
11+
--color-primary-foreground: hsl(210 40% 98%);
12+
--color-secondary: hsl(210 40% 96.1%);
13+
--color-secondary-foreground: hsl(222.2 47.4% 11.2%);
14+
--color-muted: hsl(210 40% 96.1%);
15+
--color-muted-foreground: hsl(215.4 16.3% 46.9%);
16+
--color-accent: hsl(210 40% 96.1%);
17+
--color-accent-foreground: hsl(222.2 47.4% 11.2%);
18+
--color-destructive: hsl(0 84.2% 60.2%);
19+
--color-destructive-foreground: hsl(210 40% 98%);
20+
--color-border: hsl(214.3 31.8% 91.4%);
21+
--color-input: hsl(214.3 31.8% 91.4%);
22+
--color-ring: hsl(221.2 83.2% 53.3%);
23+
--color-chart-1: hsl(12 76% 61%);
24+
--color-chart-2: hsl(173 58% 39%);
25+
--color-chart-3: hsl(197 37% 24%);
26+
--color-chart-4: hsl(43 74% 66%);
27+
--color-chart-5: hsl(27 87% 67%);
28+
29+
--radius-lg: 0.5rem;
30+
--radius-md: calc(0.5rem - 2px);
31+
--radius-sm: calc(0.5rem - 4px);
3332
}
3433

3534
@layer base {
3635
* {
37-
border-color: hsl(var(--border));
36+
border-color: var(--color-border);
3837
}
3938

4039
body {
41-
background-color: hsl(var(--background));
42-
color: hsl(var(--foreground));
40+
background-color: var(--color-background);
41+
color: var(--color-foreground);
4342
margin: 0;
4443
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
4544
}

0 commit comments

Comments
 (0)