feat: add separate tailwindcss v3 plugin (#3135)

Makes it easier to keep using tailwindcss v3 with newer Fresh versions.
This commit is contained in:
Marvin Hagemeister
2025-07-25 10:27:22 +02:00
committed by GitHub
parent 76002fef0e
commit d573622a40
6 changed files with 1039 additions and 8 deletions
+14 -2
View File
@@ -26,11 +26,10 @@ that.
```diff dev.ts
import { Builder } from "fresh/dev";
import { app } from "./main.ts";
+ import { tailwind } from "@fresh/plugin-tailwind";
const builder = new Builder();
+ tailwind(builder, app);
+ tailwind(builder);
```
4. Add `@import "tailwindcss";` at the top of your main stylesheet.
@@ -52,3 +51,16 @@ tailwind(builder, app, {
base: null,
});
```
## Tailwindcss v3
If can't update to the current version of tailwindcss we have a dedicated
`@fresh/plugin-tailwindcss-v3` plugin that uses tailwindcss v3. That way you can
decided on your own when it's best to update to v4.
```ts dev.ts
import { Builder } from "fresh/dev";
import { tailwind } from "@fresh/plugin-tailwindcss-v3";
tailwind(builder, {});
```