Track animation names in CSS analysis#608
Merged
Merged
Conversation
Adds { type: 'name', value: Node } to the items emitted by analyzeAnimation
so consumers can extract animation names from shorthand values without
maintaining their own keyword exclusion list.
A new ANIMATION_NON_NAME_KEYWORDS set covers direction, fill-mode,
play-state and iteration-count reserved words; any remaining identifier
that doesn't match timing keywords or global CSS keywords is emitted as name.
Closes #604
Adds values.animations.names to the analyze() output. Names are collected from the `animation` shorthand (via the new name callback from analyzeAnimation) and from the `animation-name` longhand property. Dashed-idents like --my-name are valid animation names and are collected as-is (case preserved). Transition property names are excluded since they go through the same shorthand handler but with a different property.
Bundle ReportChanges will increase total bundle size by 750 bytes (0.94%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: analyzeCss-esmAssets Changed:
Files in
Files in
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #608 +/- ##
==========================================
- Coverage 94.48% 94.25% -0.24%
==========================================
Files 18 18
Lines 1016 1027 +11
Branches 321 325 +4
==========================================
+ Hits 960 968 +8
- Misses 46 48 +2
- Partials 10 11 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds tracking and analysis of animation names used in CSS animations, complementing the existing analysis of animation durations and timing functions.
Key Changes
animationNamescollection to track all animation names used in stylesheetsanalyzeAnimationfunction: Extended to emitnametype items for animation identifiers while filtering out reserved keywords (direction, fill-mode, play-state, iteration-count, and timing-function keywords)animationandanimation-nameproperties:animationshorthand propertyanimation-namepropertynamesfield toanimationsobject in analysis results, containing total count, unique count, and uniqueness ratioImplementation Details
ANIMATION_NON_NAME_KEYWORDSset to distinguish animation names from other valid animation shorthand keywordsanimationoranimation-name(not fortransition)--my-name)https://claude.ai/code/session_01HVDNrfgMVDeSY69NYHoYH2