feat(expandable-section): animate expansion#7487
Conversation
|
Preview: https://patternfly-pr-7487.surge.sh A11y report: https://patternfly-pr-7487-a11y.surge.sh |
|
Can we please try |
|
@andrew-ronaldson used If you want to take a stab at tweaking any of these yourself, you can do this in the PR. In dev tools, just select the expandable section you want to modify and in the HTML, be sure to select the
|
andrew-ronaldson
left a comment
There was a problem hiding this comment.
You've expanded my mind, maaaaaan.✌️
Farrr oooout, maaaaan!
|
@andrew-ronaldson some wonderful comments from @thatblindgeye with my responses inline
FYI detached just means the toggle and expandable content aren't one single HTML block. They can be right next to one another, or the toggle could be in a toolbar and the content could be in a separate page section. Also that means the expanded content could be on any side of the toggle. We have a variation of the expandable toggle (just the toggle, not the content) for
D'oh! Good catch, I missed that. The way that truncates is using
Also great catch. Delayed that padding change so it matches when the expandable content is shown/hidden. |
|
In addition to the above, looks like React will have to handle when to apply that Just removing that hidden attribute in React and updating the |
| --#{$expandable-section}__content--TransitionDuration--slide: var(--#{$expandable-section}__content--TransitionDuration--expand--slide); | ||
| --#{$expandable-section}__content--TransitionDuration--fade: var(--#{$expandable-section}__content--TransitionDuration--expand--fade); | ||
| --#{$expandable-section}__content--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default); | ||
| --#{$expandable-section}__content--TransitionDelay: 0; |
| --#{$expandable-section}__toggle-icon--m-expand-top--Rotate: 0; | ||
| --#{$expandable-section}--m-expanded__toggle-icon--Rotate: 90deg; | ||
| --#{$expandable-section}--m-expanded__toggle-icon--m-expand-top--Rotate: -90deg; | ||
| --#{$expandable-section}__content--TransitionDuration--expand--slide: 0s; |
There was a problem hiding this comment.
I'm failing to see how this is needed. I tried adjusting it and removing it and didn't see any difference.
There was a problem hiding this comment.
It's part of the default values to keep the slide from happening in reduced motion. By default, --#{$expandable-section}__content--TransitionDuration--expand--slide and --#{$expandable-section}__content--TransitionDuration--collapse--slide are "0s" (the expand and collapse "slide", aka translate, duration), and --#{$expandable-section}__content--TranslateY is 0 (the "slide" amount).
For reduced motion "no-preference," those are changed to the motion amounts.
|
Shortened the collapse duration, changed the slide amount from 1rem to .5rem. Also reversed the role of the |
|
🎉 This PR is included in version 6.3.0-prerelease.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |

fixes #7205
To see the animation
<div class="pf-m-expanded pf-v6-c-expandable-section">element