keyframe selectors "overly analyzed"
See original GitHub issueSuppose I have a CSS like this:
@keyframes RotateSlot {
0% { margin-top: 0 }
3% { margin-top: -2em }
20% { margin-top: -2em }
23% { margin-top: -4em }
40% { margin-top: -4em }
43% { margin-top: -6em }
60% { margin-top: -6em }
63% { margin-top: -8em }
90% { margin-top: -8em }
93% { margin-top: 0 }
100% { margin-top: 0 }
}
When I run that, this happens:
▶ ./bin/minimalcss.js -d http://localhost:8080/keyframe.html
0% SyntaxError: Unmatched selector: %
3% SyntaxError: Unmatched selector: %
20% SyntaxError: Unmatched selector: %
23% SyntaxError: Unmatched selector: %
40% SyntaxError: Unmatched selector: %
43% SyntaxError: Unmatched selector: %
60% SyntaxError: Unmatched selector: %
63% SyntaxError: Unmatched selector: %
90% SyntaxError: Unmatched selector: %
93% SyntaxError: Unmatched selector: %
100% SyntaxError: Unmatched selector: %
It basically thinks 0%
is a CSS selector and it tries to look for that in the DOM (using cheerio
). I.e. dom('0%').length > 0
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
keyframes - CSS: Cascading Style Sheets - MDN Web Docs
Each @keyframes rule contains a style list of keyframe selectors, which specify percentages along the animation when the keyframe occurs, and a ...
Read more >Keyframe Animation Syntax | CSS-Tricks
Hi guys I want to be able to control the “frames” so I have 5 frames inside of one CSS sprite. They represent...
Read more >CSS Keyframes: A Brief Introduction with Examples - Simplilearn
In CSS, keyframes are used for animations. It gives you more control over the animation you want to perform. The animation is created...
Read more >Create more complex animations using CSS @keyframes
@keyframes animations are different. When animation-name and animation-duration are assigned to a selector, the properties and values contained ...
Read more >How to dynamically create '@-Keyframe' CSS animations?
But, say you want to dynamically keep adding in keyframes over and over again, then your webpage get really ... This method has...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Inside
@keyframes
a rules are using. That’s not a regular rules, butkeyframe-block
. However, at the moment CSSTree uses the same node type for both cases. I’m thinking about introducing an additional node types for that. For now you can usethis.atrule.name
andcsstree.keyword()
to filter rules, as you already did.Let’s use
csstree.keyword(this.atrule.name).basename
instead ofthis.atrule.name