Tailwind 4 was producing only theme variables (oklch colors) without any utility classes because Astro had no astro.config.mjs wiring the @tailwindcss/vite plugin. Result: site rendered unstyled despite all components and HTML being correct. Verified locally after fix: - CSS bundle grew from 21 KB (theme only) to 36 KB (theme + utilities) - 23 utility-class definitions present (bg-neutral-900, text-white, min-h-screen, backdrop-blur, font-bold, flex etc) Also adds @source directive in global.css to ensure Tailwind scans .astro files for class usage.
9 lines
170 B
JavaScript
9 lines
170 B
JavaScript
import { defineConfig } from 'astro/config';
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
|
|
export default defineConfig({
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
},
|
|
});
|