-
Notifications
You must be signed in to change notification settings - Fork 190
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
fix: CSS-wide keywords and none
in @keyframes
cannot remove quotes
#267
Conversation
c08068a
to
4dc1f3e
Compare
e.g. ``` @Keyframes "revert" {} ```
Co-Authored-By: Jason <[email protected]>
Co-Authored-By: 一丝 <[email protected]> Co-Authored-By: Jason <[email protected]>
4dc1f3e
to
f9c49fe
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.
Thanks! We'll need to update AnimationName
in properties/animation.rs the same way as KeyframesName
.
if context.unused_symbols.contains(keyframes.name.0.as_ref()) { | ||
if context | ||
.unused_symbols | ||
.contains(&keyframes.name.to_css_string(Default::default()).unwrap()) |
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.
This will result in the name being quoted/escaped, but the unused_symbols
list won't be. You'll need to do a match
on the keyframe name to pull out the embedded string.
Can I fix it in the next PR? Here I want to focus on |
In the
@keyframes
rule, this is an invalid syntax if the<keyframes-name>
is CSS-wide keywords ornone
keyword.Before this PR, we would always remove the quotes, which would result in generating an invalid CSS if the quotes happened to be CSS-wide keywords.
Before
After
Throw an error
With the new parsing method, the following cases will throw an error, which was previously considered a legal CSS rule.