Different units and dynamic variable values #4677
Open
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.
I extended the functionality of the existing collapse plugin to allow using any known CSS unit or any CSS variable.
Ex.:
x-collapse.min.var(--collapse-min)will now work.x-collapse.min.100lvhwill now work.x-collapse.min.100still fallbacks to pixels.The variable detection hence allows Tailwind to set arbitrary values to variables with responsive variants.
The example above allows us to set a minimum height to 100px on mobile and to 500px on desktop (lg screen size in Tailwind).
Maybe issue? : parentheses aren't technically in the spec for HTML attributes, but supported in all major browsers.
Adresses #2282, #2984 and might invalidate #4547