Skip to content

Conversation

@zipper
Copy link
Owner

@zipper zipper commented Feb 21, 2025

While a CollapsableItem is expanding or collapsing, the data-collapsable-state attribute is set to expanding or collapsing. This attribute is removed immediately after the transition completes.

This can be useful in CSS, for example, to apply @starting-style only to the item currently expanding or collapsing. This makes it easier to use display: none for hiding collapsed items while still allowing transitions for expansion. Additionally, when applied via the data attribute, @starting-style won’t affect nested collapsable elements that are already expanded, preventing unwanted transitions.

While a `CollapsableItem` is expanding or collapsing, the `data-collapsable-state` attribute is set to `expanding` or `collapsing`. This attribute is removed immediately after the transition completes.

This can be useful in CSS, for example, to apply `@starting-style` only to the item currently expanding or collapsing. This makes it easier to use `display: none` for hiding collapsed items while still allowing transitions for expansion. Additionally, when applied via the data attribute, `@starting-style` won’t affect nested collapsable elements that are already expanded, preventing unwanted transitions.
@zipper zipper force-pushed the feature-data-collapsable-state branch from f098428 to 24efa9e Compare February 21, 2025 10:27
@zipper zipper merged commit 295aa38 into master Feb 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants