Add experimental support for Tailwind CSS v4 #420
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tailwind CSS v4 is a big overhaul in how tailwind detects CSS classes. Instead of specifying config and input files, the CLI scans the entire project directory.
More information on this change here: https://tailwindcss.com/blog/tailwindcss-v4-alpha
This PR updates the build and watch commands to skip the
-i
and-c
parameters if the version of Tailwindcss::Ruby is v4.This PR also adds matrixed (across Tailwind v3 and v4) unit test coverage for the base commands, and integration test coverage for the generated CSS file.
Known issue: this logic will break for users who are using the
TAILWINDCSS_INSTALL_DIR
feature oftailwindcss-ruby
to run a different version of tailwindcss than declared by the gem. This PR hides that version check behind theCommands.tailwindcss_version
method, so we can deal with that once someone complains about it.Closes #419