-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supports
variant compiles function syntax incorrectly
#13594
Comments
One solution here could be to explicitly detect and ignore known function syntaxes, as it appears to be a very finite and set concrete list:
Doing it this way and not arbitrarily matching a UPDATE: In my related PR #13596, I opted to support the hyphen character in
|
Thoughts for the future — it could be helpful to set up extensions to the
|
@adamwathan I opened PR #13596, which should resolve this issue. It does not fix the You can see here that this was an issue before: https://play.tailwindcss.com/M7FOiImx9l I confirmed that example ( |
Reopening so we fix this in v3 as well. |
@adamwathan #13605 should fix this for v3 |
… is (#13605) This is the v3 equivalent of PR #13596 Matching for the hyphen character in the existing regex to use support queries as-is Resolves #13594 Tests (w/ updated): - ✅ `supports-[display:grid]:grid` - ✅ `supports-[transform-origin:5%_5%]:underline` - ✅ `supports-[not(foo:bar)]:underline` - ✅ `supports-[(foo:bar)or(bar:baz)]:underline` - ✅ `supports-[(foo:bar)and(bar:baz)]:underline` - ✅ `supports-[(foo:bar)_and_(bar:baz)]:grid` - ✅ `supports-[(foo:bar)_and_(bar:baz)_or(baz:qux)]:grid` - ✅ `supports-[container-type]:underline` - ✅ `supports-grid:underline` - ✅ `supports-[--test]:flex` - ✅ `supports-[selector(A_>_B)]:underline` - ✅ `supports-[font-format(opentype)]:grid` - ✅ `supports-[font-tech(color-COLRv1)]:flex` --------- Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
Closing this one since it's fixed in v4. Doesn't appear fixed in v3 oddly in my testing even though apparently #13605 fixed it but whatever. |
What version of Tailwind CSS are you using?
v3 and v4
Reproduction URL
https://play.tailwindcss.com/ySYgzSn5FT
Describe your issue
Classes like
supports-[font-format(opentype)]:grid
generate invalid CSS, because we currently assume that supports values that don't contain:
are a CSS property and we insert a variable at the end in an attempt to make the query valid:This isn't a crazy complicated thing to fix but there are a number of test cases to consider:
The text was updated successfully, but these errors were encountered: