Rather frustratingly I am receiving the following error when trying to migrate to Tailwind 4:
It looks like you're trying to use
tailwindcssdirectly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install@tailwindcss/postcssand update your PostCSS configuration.
My changes:
diff --git a/astro.config.mjs b/astro.config.mjs
index bc23939..9e6c031 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -3,6 +3,7 @@ import starlight from "@astrojs/starlight";
import tailwind from "@astrojs/tailwind";
import { shield } from "@kindspells/astro-shield";
import starlightUtils from "@lorenzo_lewis/starlight-utils";
+import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "astro/config";
import starlightBlog from "starlight-blog";
import starlightCoolerCredit from "starlight-cooler-credit";
@@ -68,6 +69,7 @@ export default defineConfig({
},
},
customImage: "./src/assets/heart.png",
+ customImageAlt: "heart",
}),
],
sidebar: await generateSidebar(),
@@ -84,4 +86,7 @@ export default defineConfig({
}),
],
site: "https://www.waterfox.net",
+ vite: {
+ plugins: [tailwindcss()],
+ },
});
diff --git a/src/assets/global.css b/src/assets/global.css
index ca25a14..80fd96c 100644
--- a/src/assets/global.css
+++ b/src/assets/global.css
@@ -1,6 +1,4 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
+@import "tailwindcss";
@layer base {
html,
As you can see, no PostCSS involvement at all, so I'm confused as to where this error is coming from?