`analyzeAnimation` drops quoted animation names
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start at analyzeAnimation in @projectwallace/css-analyzer/values and inspect how identifier, dimension, and function nodes are handled alongside string nodes. Confirm that quoted names in animation-name and animation shorthand invoke the name callback with the StringNode, and verify that quoted keyframes are no longer reported as unused in the full analyze() output.
Written by the indexing model from the issue text.
Description
analyzeAnimation silently drops quoted animation names (<string> nodes)
@projectwallace/css-analyzer/values — analyzeAnimation
The CSS Animations spec defines <keyframes-name> as <custom-ident> | <string>, meaning quoted strings are valid animation names in both animation-name and the animation shorthand:
@keyframes "slide in" { from { opacity: 0 } to { opacity: 1 } }
a { animation-name: "slide in"; } /* valid */
a { animation: "slide in" 1s ease; } /* valid */
analyzeAnimation only processes is_identifier, is_dimension, and is_function nodes. is_string nodes are silently skipped, so quoted animation names produce no callback at all — they're invisible to callers.
Expected: analyzeAnimation calls the callback with { type: 'name', value: <StringNode> } for string nodes that appear in the name position.
Actual: the callback is never invoked; the quoted name is dropped entirely.
This also means atrules.keyframes in the full analyze() output will show quoted keyframe names as unused even when they are referenced by a quoted animation-name value.
Workaround we're currently using in stylelint-plugin:
analyzeAnimation(ast, ({ type, value }) => {
if (type === 'name') tracker.use(value.text)
})
// analyzeAnimation doesn't handle <string> nodes — work around until fixed
for (const node of ast) {
if (node.type === STRING) tracker.use(node.text)
}
- Dominant language
- TypeScript
- Stars
- 366
- Forks
- 15
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from projectwallace/css-analyzer
-
✨ enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
projectwallace/css-analyzer#605 ·
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
projectwallace/css-analyzer#613 · 3 comments ·
-
✨ enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
projectwallace/css-analyzer#607 ·
-
Add value-level helper to extract keyframe names referenced in `animation` / `animation-name` values Open✨ enhancement
Difficulty 3/5 1-2 days Newbie friendliness 68/100
projectwallace/css-analyzer#606 ·
-
✨ enhancement
Difficulty 3/5 1-2 days Newbie friendliness 74/100
projectwallace/css-analyzer#603 ·
All issues in projectwallace/css-analyzer
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100