From 3e8a4ddc402ef7db4704cfa1afab0bedbd27510e Mon Sep 17 00:00:00 2001 From: Linus Olofsson <61837116+LinusOlofsson-maker@users.noreply.github.com> Date: Wed, 20 May 2026 22:36:19 +0200 Subject: [PATCH] fix: add astro.config.mjs with @tailwindcss/vite plugin 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. --- astro.config.mjs | 8 ++++++++ src/styles/global.css | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 astro.config.mjs diff --git a/astro.config.mjs b/astro.config.mjs new file mode 100644 index 0000000..2b45c70 --- /dev/null +++ b/astro.config.mjs @@ -0,0 +1,8 @@ +import { defineConfig } from 'astro/config'; +import tailwindcss from '@tailwindcss/vite'; + +export default defineConfig({ + vite: { + plugins: [tailwindcss()], + }, +}); diff --git a/src/styles/global.css b/src/styles/global.css index a461c50..08ab157 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1 +1,4 @@ -@import "tailwindcss"; \ No newline at end of file +@import "tailwindcss"; + +@source "../**/*.{astro,html,js,jsx,ts,tsx,md,mdx,svelte,vue}"; +@source "../../public/**/*.html";