-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Improve arbitrary value validation when parsing candidates #17361
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
Conversation
@@ -552,6 +564,9 @@ export function parseVariant(variant: string, designSystem: DesignSystem): Varia | |||
|
|||
let selector = decodeArbitraryValue(variant.slice(1, -1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda bothers me that this var is called selector
and not arbitraryValue
like in the 5 other places that look identical haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, in this case it is a selector because of the variant :P
[.foo]:…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bg-[url(https://example.com?q=;)]
will be thrown out but works in postcss so we might allow this too
https://jsfiddle.net/cg6v57mp/1/ In Play this works: https://play.tailwindcss.com/hCXYekpfy6 Looked into this, and it looks like a Tailwind Play issue because Tailwind CSS itself does properly generate the correct CSS: div {
background-color: url(https://github.com/tailwindlabs.png?q=;);
} Output: div {
background-color: url(https://github.com/tailwindlabs.png?q=;);
} Even running it through Lightning CSS keeps working as expected: div {
background-color: url("https://github.com/tailwindlabs.png?q=;");
} |
f4026bd
to
8839dd3
Compare
8839dd3
to
6276ab3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha I see, inlined it. Makes sense 👍
I'll fix the Play thing separately. I'm pretty sure I know what the problem is there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #17357 This affects the CDN and Play Now candidates like these no longer parse and emit CSS: - `[--foo:1rem;--bar:2rem]` - `[&{color:red}]:flex` - `data-[a]{color:red}foo[a]:flex`
Fixes #17357
This affects the CDN and Play
Now candidates like these no longer parse and emit CSS:
[--foo:1rem;--bar:2rem]
[&{color:red}]:flex
data-[a]{color:red}foo[a]:flex