Skip to content

Conversation

@Elijbet
Copy link
Contributor

@Elijbet Elijbet commented Jan 15, 2026

Related Issue: #12669

Summary

As part of aligning animation implementation on expanded/collapsed components, swap animation with transition on block.

@github-actions github-actions bot added the refactor Issues tied to code that needs to be significantly reworked. label Jan 15, 2026
Copy link
Contributor Author

@Elijbet Elijbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why transition is better for expanded/collapsed components:

  1. Automatic reversal - When you remove expanded, it automatically fades out. With animation, you'd need a separate fade-out animation.
  2. Simpler code - No keyframes needed for a simple 0→1 change.
  3. Better for state-driven UIs - React/Vue/Lit etc. work naturally with class/state toggles.
  4. Slightly better performance - Transitions are optimized for property changes.

Animation with keyframes approach works fine, but it's typically used when you need that animation to play once on render, or when the animation has multiple steps that transition can't handle elegantly.

@Elijbet Elijbet requested a review from jcfranco January 15, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Issues tied to code that needs to be significantly reworked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants