From 0bf47751ba98000cd299824e73f85b161d78e83c Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Mon, 15 Jun 2026 22:06:42 +0700 Subject: [PATCH] fix: replace Tailwind v4 CSS syntax with v3 directives in index.css MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The project uses Tailwind v3 (package.json: "tailwindcss": "^3.4.11") but index.css was using Tailwind v4 CSS-first syntax: - @import "tailwindcss" → replaced with @tailwind base/components/utilities - @import "tw-animate-css" → removed (not installed; tailwindcss-animate v3 is used instead) - @custom-variant dark → removed (v4 only) - @theme inline { ... } → removed (v4 only; config already in tailwind.config.ts) - @utility container → removed (v4 only; config already in tailwind.config.ts) Also fixed CSS variable format: removed hsl() wrappers from variable values since tailwind.config.ts already wraps them as hsl(var(--name)). Fixed --sidebar → --sidebar-background to match tailwind.config.ts. Co-authored-by: shakespeare.diy --- src/index.css | 249 +++++++++++++++++--------------------------------- 1 file changed, 83 insertions(+), 166 deletions(-) diff --git a/src/index.css b/src/index.css index e499073..dbb49f9 100644 --- a/src/index.css +++ b/src/index.css @@ -1,187 +1,104 @@ -@import "tailwindcss"; -@import "tw-animate-css"; +@tailwind base; +@tailwind components; +@tailwind utilities; -@custom-variant dark (&:is(.dark *)); +@layer base { + :root { + --radius: 0.75rem; -@theme inline { - --color-background: var(--background); - --color-foreground: var(--foreground); + --background: 0 0% 100%; + --foreground: 222.2 84% 4.9%; - --color-card: var(--card); - --color-card-foreground: var(--card-foreground); + --card: 0 0% 100%; + --card-foreground: 222.2 84% 4.9%; - --color-popover: var(--popover); - --color-popover-foreground: var(--popover-foreground); + --popover: 0 0% 100%; + --popover-foreground: 222.2 84% 4.9%; - --color-primary: var(--primary); - --color-primary-foreground: var(--primary-foreground); + --primary: 222.2 47.4% 11.2%; + --primary-foreground: 210 40% 98%; - --color-secondary: var(--secondary); - --color-secondary-foreground: var(--secondary-foreground); + --secondary: 210 40% 96.1%; + --secondary-foreground: 222.2 47.4% 11.2%; - --color-muted: var(--muted); - --color-muted-foreground: var(--muted-foreground); + --muted: 210 40% 96.1%; + --muted-foreground: 215.4 16.3% 46.9%; - --color-accent: var(--accent); - --color-accent-foreground: var(--accent-foreground); + --accent: 210 40% 96.1%; + --accent-foreground: 222.2 47.4% 11.2%; - --color-destructive: var(--destructive); - --color-destructive-foreground: var(--destructive-foreground); + --destructive: 0 84.2% 60.2%; + --destructive-foreground: 210 40% 98%; - --color-border: var(--border); - --color-input: var(--input); - --color-ring: var(--ring); + --border: 214.3 31.8% 91.4%; + --input: 214.3 31.8% 91.4%; + --ring: 222.2 84% 4.9%; - --color-chart-1: var(--chart-1); - --color-chart-2: var(--chart-2); - --color-chart-3: var(--chart-3); - --color-chart-4: var(--chart-4); - --color-chart-5: var(--chart-5); + --chart-1: 12 76% 61%; + --chart-2: 173 58% 39%; + --chart-3: 197 37% 24%; + --chart-4: 43 74% 66%; + --chart-5: 27 87% 67%; - --color-sidebar: var(--sidebar); - --color-sidebar-foreground: var(--sidebar-foreground); - --color-sidebar-primary: var(--sidebar-primary); - --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); - --color-sidebar-accent: var(--sidebar-accent); - --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); - --color-sidebar-border: var(--sidebar-border); - --color-sidebar-ring: var(--sidebar-ring); - - --radius-lg: var(--radius); - --radius-md: calc(var(--radius) - 2px); - --radius-sm: calc(var(--radius) - 4px); - --radius-xl: calc(var(--radius) + 4px); - - --animate-accordion-down: accordion-down 0.2s ease-out; - --animate-accordion-up: accordion-up 0.2s ease-out; - - @keyframes accordion-down { - from { - height: 0; - } - to { - height: var(--radix-accordion-content-height); - } + --sidebar-background: 0 0% 98%; + --sidebar-foreground: 240 5.3% 26.1%; + --sidebar-primary: 240 5.9% 10%; + --sidebar-primary-foreground: 0 0% 98%; + --sidebar-accent: 240 4.8% 95.9%; + --sidebar-accent-foreground: 240 5.9% 10%; + --sidebar-border: 220 13% 91%; + --sidebar-ring: 217.2 91.2% 59.8%; } - @keyframes accordion-up { - from { - height: var(--radix-accordion-content-height); - } - to { - height: 0; - } + .dark { + --background: 222.2 84% 4.9%; + --foreground: 210 40% 98%; + + --card: 222.2 84% 4.9%; + --card-foreground: 210 40% 98%; + + --popover: 222.2 84% 4.9%; + --popover-foreground: 210 40% 98%; + + --primary: 210 40% 98%; + --primary-foreground: 222.2 47.4% 11.2%; + + --secondary: 217.2 32.6% 17.5%; + --secondary-foreground: 210 40% 98%; + + --muted: 217.2 32.6% 17.5%; + --muted-foreground: 215 20.2% 65.1%; + + --accent: 217.2 32.6% 17.5%; + --accent-foreground: 210 40% 98%; + + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 210 40% 98%; + + --border: 217.2 32.6% 17.5%; + --input: 217.2 32.6% 17.5%; + --ring: 212.7 26.8% 83.9%; + + --chart-1: 220 70% 50%; + --chart-2: 160 60% 45%; + --chart-3: 30 80% 55%; + --chart-4: 280 65% 60%; + --chart-5: 340 75% 55%; + + --sidebar-background: 240 5.9% 10%; + --sidebar-foreground: 240 4.8% 95.9%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; + --sidebar-accent: 240 3.7% 15.9%; + --sidebar-accent-foreground: 240 4.8% 95.9%; + --sidebar-border: 240 3.7% 15.9%; + --sidebar-ring: 217.2 91.2% 59.8%; } } -/* Container utility replacement for v4 (previously configured in tailwind.config) */ -@utility container { - margin-inline: auto; - padding-inline: 2rem; - @media (width >= 1400px) { - max-width: 1400px; - } -} - -:root { - --radius: 0.75rem; - - --background: hsl(0 0% 100%); - --foreground: hsl(222.2 84% 4.9%); - - --card: hsl(0 0% 100%); - --card-foreground: hsl(222.2 84% 4.9%); - - --popover: hsl(0 0% 100%); - --popover-foreground: hsl(222.2 84% 4.9%); - - --primary: hsl(222.2 47.4% 11.2%); - --primary-foreground: hsl(210 40% 98%); - - --secondary: hsl(210 40% 96.1%); - --secondary-foreground: hsl(222.2 47.4% 11.2%); - - --muted: hsl(210 40% 96.1%); - --muted-foreground: hsl(215.4 16.3% 46.9%); - - --accent: hsl(210 40% 96.1%); - --accent-foreground: hsl(222.2 47.4% 11.2%); - - --destructive: hsl(0 84.2% 60.2%); - --destructive-foreground: hsl(210 40% 98%); - - --border: hsl(214.3 31.8% 91.4%); - --input: hsl(214.3 31.8% 91.4%); - --ring: hsl(222.2 84% 4.9%); - - --chart-1: hsl(12 76% 61%); - --chart-2: hsl(173 58% 39%); - --chart-3: hsl(197 37% 24%); - --chart-4: hsl(43 74% 66%); - --chart-5: hsl(27 87% 67%); - - --sidebar: hsl(0 0% 98%); - --sidebar-foreground: hsl(240 5.3% 26.1%); - --sidebar-primary: hsl(240 5.9% 10%); - --sidebar-primary-foreground: hsl(0 0% 98%); - --sidebar-accent: hsl(240 4.8% 95.9%); - --sidebar-accent-foreground: hsl(240 5.9% 10%); - --sidebar-border: hsl(220 13% 91%); - --sidebar-ring: hsl(217.2 91.2% 59.8%); -} - -.dark { - --background: hsl(222.2 84% 4.9%); - --foreground: hsl(210 40% 98%); - - --card: hsl(222.2 84% 4.9%); - --card-foreground: hsl(210 40% 98%); - - --popover: hsl(222.2 84% 4.9%); - --popover-foreground: hsl(210 40% 98%); - - --primary: hsl(210 40% 98%); - --primary-foreground: hsl(222.2 47.4% 11.2%); - - --secondary: hsl(217.2 32.6% 17.5%); - --secondary-foreground: hsl(210 40% 98%); - - --muted: hsl(217.2 32.6% 17.5%); - --muted-foreground: hsl(215 20.2% 65.1%); - - --accent: hsl(217.2 32.6% 17.5%); - --accent-foreground: hsl(210 40% 98%); - - --destructive: hsl(0 62.8% 30.6%); - --destructive-foreground: hsl(210 40% 98%); - - --border: hsl(217.2 32.6% 17.5%); - --input: hsl(217.2 32.6% 17.5%); - --ring: hsl(212.7 26.8% 83.9%); - - --chart-1: hsl(220 70% 50%); - --chart-2: hsl(160 60% 45%); - --chart-3: hsl(30 80% 55%); - --chart-4: hsl(280 65% 60%); - --chart-5: hsl(340 75% 55%); - - --sidebar: hsl(240 5.9% 10%); - --sidebar-foreground: hsl(240 4.8% 95.9%); - --sidebar-primary: hsl(224.3 76.3% 48%); - --sidebar-primary-foreground: hsl(0 0% 100%); - --sidebar-accent: hsl(240 3.7% 15.9%); - --sidebar-accent-foreground: hsl(240 4.8% 95.9%); - --sidebar-border: hsl(240 3.7% 15.9%); - --sidebar-ring: hsl(217.2 91.2% 59.8%); -} - @layer base { - *, - ::after, - ::before, - ::backdrop, - ::file-selector-button { - border-color: var(--color-border, currentcolor); + * { + @apply border-border; } body {