Josh W Comeau
Read post

The Big Gotcha With @starting-style • Josh W. Comeau

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

The @starting-style CSS at-rule allows transitions for enter animations but has a significant specificity gotcha. Unlike keyframe animations, @starting-style declarations aren't promoted to a higher priority group, causing them to lose to more specific selectors. This creates unexpected behavior where animations fail to run when conflicting with inline styles or higher-specificity selectors. The post explores three solutions: using !important (not recommended), CSS custom properties (elegant but complex), or falling back to keyframe animations (simple and reliable). The author questions whether @starting-style offers real advantages over existing keyframe animations.

    #webdev#css
Sep 22, 2025•12m read time•From joshwcomeau.com
Post cover image
Table of contents
Table of ContentsLink to this heading The specificity problemLink to this heading SolutionsLink to this heading Syntactic sugar?Link to this heading An exciting announcement
37.9K Impressions1 Comment
Josh W Comeau's image
Josh W Comeau

Josh W. Comeau's platform provides resources in frontend development, React.js, and CSS, offering in...

529 Followers

•

2.5K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard