8000 chore(multiple): make icon rotation expansion transitions consistent by srambach · Pull Request #7392 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

chore(multiple): make icon rotation expansion transitions consistent#7392

Merged
mcoker merged 5 commits intopatternfly:mainfrom
srambach:6959-tokens-for-caret-animation
Mar 13, 2025
Merged

chore(multiple): make icon rotation expansion transitions consistent#7392
mcoker merged 5 commits intopatternfly:mainfrom
srambach:6959-tokens-for-caret-animation

Conversation

@srambach
Copy link
Member
@srambach srambach commented Mar 7, 2025

Fixes #6959

Puts tokens and vars where transitions were hard coded.
Breaks apart shorthand transition into separate properties.
Where the --long duration token was used for the expansion toggle rotation, it was changed to --default (per design team on slack)

@patternfly-build
Copy link
Collaborator
patternfly-build commented Mar 7, 2025

Copy link
@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

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

love it!

Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

Wired this up to a react dev server to validate and found a few bugs. Also looks like a lot of these don't have to be written as shorthand since they don't require a single --Transition var.

--#{$form}__field-group-toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--long);
--#{$form}__field-group-toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default);
--#{$form}__field-group-toggle-icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default);
--#{$form}__field-group-toggle-icon--Transition: transform var(---#{$form}__field-group-toggle-icon--TransitionDuration) var(--#{$form}__field-group-toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
Copy link
Contributor

Choose a reason for hiding this comment

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

There is an extra - keeping this animation from working. Though this can be longhand, too - you don't need the --Transition var

Suggested change
--#{$form}__field-group-toggle-icon--Transition: transform var(---#{$form}__field-group-toggle-icon--TransitionDuration) var(--#{$form}__field-group-toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
--#{$form}__field-group-toggle-icon--Transition: transform var(--#{$form}__field-group-toggle-icon--TransitionDuration) var(--#{$form}__field-group-toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property

--#{$jump-links}__toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--long);
--#{$jump-links}__toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default);
--#{$jump-links}__toggle-icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default);
--#{$jump-links}__toggle-icon--Transition: tranform var(--#{$jump-links}__toggle-icon--TransitionDuration) var(--#{$jump-links}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo in transform - but you can remove this --Transition var and make it longhand, too.

Suggested change
--#{$jump-links}__toggle-icon--Transition: tranform var(--#{$jump-links}__toggle-icon--TransitionDuration) var(--#{$jump-links}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
--#{$jump-links}__toggle-icon--Transition: transform var(--#{$jump-links}__toggle-icon--TransitionDuration) var(--#{$jump-links}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property

@include pf-v6-mirror-inline-on-rtl;

transition: transform var(--#{$table}__toggle--c-button__toggle-icon--TransitionDuration) var(--#{$table}__toggle--c-button__toggle-icon--TransitionTimingFunction);
transform: rotate(var(--#{$table}__toggle--c-button__toggle-icon--Rotate));
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this was removed accidentally? Currently all toggles point down whether they're expanded or not.
Screenshot 2025-03-11 at 10 16 34 PM


display: inline-block;
transition: transform var(--#{$card}__header-toggle-icon--TransitionDuration) var(--#{$card}__header-toggle-icon--TransitionTimingFunction);
transition: var(--#{$card}__header-toggle-icon--Transition); // TODO remove shorthand in breaking change
Copy link
Contributor

Choose a reason for hiding this comment

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

Since --#{$card}__header-toggle-icon--Transition didn't exist before, you don't need to add it and can make it longhand.

color: var(--#{$dual-list-selector}__item-toggle-icon--Color, inherit);
text-align: center;
transition: transform var(--#{$dual-list-selector}__item-toggle-icon--TransitionDuration) var(--#{$dual-list-selector}__item-toggle-icon--TransitionTimingFunction);
transition: var(--#{$dual-list-selector}__item-toggle-icon--Transition); // TODO remove shorthand in breaking change
Copy link
Contributor

Choose a reason for hiding this comment

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

This one can be longhand, too, and you can remove --#{$dual-list-selector}__item-toggle-icon--Transition

--#{$table}__toggle__icon--Transition: .2s ease-in 0s;
--#{$table}__toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default);
--#{$table}__toggle-icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default);
--#{$table}__toggle-icon--Transition: transform var(--#{$table}__toggle-icon--TransitionDuration) var(--#{$table}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs to retain the old var name so it isn't a breaking change.

Suggested change
--#{$table}__toggle-icon--Transition: transform var(--#{$table}__toggle-icon--TransitionDuration) var(--#{$table}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
--#{$table}__toggle__icon--Transition: transform var(--#{$table}__toggle-icon--TransitionDuration) var(--#{$table}__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property

// - Table grid toggle icon
.#{$table}__toggle-icon {
transition: var(--#{$table}__toggle__icon--Transition);
transition: var(--#{$table}__toggle-icon--Transition); // TODO remove shorthand in breaking change
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
transition: var(--#{$table}__toggle-icon--Transition); // TODO remove shorthand in breaking change
transition: var(--#{$table}__toggle__icon--Transition); // TODO remove shorthand in breaking change

--#{$table}__toggle--c-button__toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--long);
--#{$table}__toggle--c-button__toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default);
--#{$table}__toggle--c-button__toggle-icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default);
--#{$table}__toggle--c-button__toggle-icon--Transition: transform var(--#{$table}__toggle--c-button__toggle-icon--TransitionDuration) var(--#{$table}__toggle--c-button__toggle-icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property
Copy link
Contributor

Choose a reason for hiding this comment

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

This --Transition var didn't exist before so you can remove it and make the property declarations longhand.

.#{$toolbar}__expand-all-icon {
display: inline-flex;
transition: transform var(--#{$toolbar}__expand-all-icon--TransitionDuration) var(--#{$toolbar}__expand-all-icon--TransitionTimingFunction);
transition: var(--#{$toolbar}__expand-all-icon--Transition); // TODO remove shorthand in breaking change
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here - you can nix the --Transition var and make it a long hand


display: inline-block;
transition: transform var(--#{$wizard}__nav-link-toggle-icon--TransitionDuration) var(--#{$wizard}__nav-link-toggle-icon--TransitionTimingFunction);
transition: var(--#{$wizard}__nav-link-toggle-icon--Transition); // TODO remove shorthand in breaking change
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here - you can nix the --Transition var and make it a long hand

@srambach srambach requested a review from mcoker March 12, 2025 17:36
Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🐸

@mcoker mcoker merged commit 29d2098 into patternfly:main Mar 13, 2025
4 checks passed
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.2.0-prerelease.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation: change hard coded transitions to use motion tokens

4 participants

0