Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate need for clip-path on .s-expandable #1142

Open
dancormier opened this issue Oct 11, 2022 · 1 comment
Open

Eliminate need for clip-path on .s-expandable #1142

dancormier opened this issue Oct 11, 2022 · 1 comment
Labels
bug A reproducible problem with the Stacks code component help-wanted Issues a person would like or needs help with

Comments

@dancormier
Copy link
Contributor

We use the clip-path property on .s-expandable to allow for height animations. Lately, it seems like more trouble than it's worth, as it affects stacking contexts in undesirable ways. We should consider ditching the animation (and the clip-path property we use here) altogether in favor of a simple display: none/block.

If we're feeling ambitious, we could do a top-to-bottom rewrite of .s-expandable to either a) find a better CSS-based approach to animating height: 0/auto or b) animate height using JS.

From MDN:

Note: A computed value other than none results in the creation of a new stacking context the same way that CSS opacity does for values other than 1.

This codepen illustrates the stacking context issue: https://codepen.io/dc-so/pen/QWmJBmz?editors=1000

@dancormier dancormier added bug A reproducible problem with the Stacks code help-wanted Issues a person would like or needs help with component labels Oct 11, 2022
@ondrejkonec
Copy link

Hi @dancormier

I tried to fix this bug by removing unnecessary styles from CSS. It also has a positive effect on the behavior of the component, when the content does not jump (the height does not flash when switching to the Radio / Checkbox button).

You can find description in pull request #1145

I will be glad for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A reproducible problem with the Stacks code component help-wanted Issues a person would like or needs help with
Projects
None yet
Development

No branches or pull requests

2 participants