Skip to content

Add support for Tailwind CSS CLI v4#50

Merged
LukeTowers merged 7 commits into
masterfrom
wip/tailwind-v4-support
Jun 20, 2026
Merged

Add support for Tailwind CSS CLI v4#50
LukeTowers merged 7 commits into
masterfrom
wip/tailwind-v4-support

Conversation

@bennothommo

@bennothommo bennothommo commented Jun 15, 2026

Copy link
Copy Markdown
Member

This PR includes support for Tailwind CSS v4. To reduce friction, it uses the same TailwindCssFilter class and has some simple version checks to ensure the correct arguments are used. It will also detect the version in use, so users will not have to manually specify their version.

There is a couple of small gotchas, but these should only manifest in projects where someone has upgraded their Tailwind CSS CLI binary to v4 without following Tailwind CSS's Upgrade Guide.

  • There is no flag for defining a config file in v4, because configuration is done within the source CSS file now. To allow our setConfigPath() method in the filter to work - if the config is specified, the following will be prepended to the source asset content:
@config '<config js path>';

This might cause problems if the user has specified a @config path in their CSS.

  • Tailwind v4 may need explicit source paths to detect which utilities are in use. Previously, in v3, one could define a content array in their configuration JS file, to specify glob paths of source HTML or frontend code. This does not work in v4, even with the above fix. The source should be specified in the CSS file with the @source tag.

@bennothommo bennothommo requested a review from a team as a code owner June 15, 2026 07:53
bennothommo added a commit that referenced this pull request Jun 15, 2026
@LukeTowers

Copy link
Copy Markdown
Member

@bennothommo is this ready to go?

@bennothommo

Copy link
Copy Markdown
Member Author

@LukeTowers good to go

@LukeTowers LukeTowers merged commit eacd5b0 into master Jun 20, 2026
9 checks passed
@LukeTowers LukeTowers deleted the wip/tailwind-v4-support branch June 20, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants