Allow !important
on CSS variables
#16873
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.
We recently fixed an issue (#16664) so that we could remove the
!important
on CSS variables. The reason we did that is because Google Chrome is showing a warning in the devtools styles panel that this is invalid. However, this is valid and the code actually works as expected.If we look at the CSS spec for this:
So given this input:
You will notice that everything works as expected, but if you look at the Styles panel in Chrome for the
<body>
element, you will see an incorrect warning. (At least that's what you used to see, I updated Chrome and everything renders fine in devtools).Play: https://play.tailwindcss.com/BpjAJ6Uxg3?file=css
This change reverts the "fix" for: #16664. @winchesHe you were the original person that opened the issue so this info might be useful to you as well. Can you verify that the Play link above does work as expected for you?
Fixes: #16810