feat(Button): add microanimation to favorites button#7379
feat(Button): add microanimation to favorites button#7379mcoker merged 6 commits intopatternfly:mainfrom
Conversation
|
Preview: https://patternfly-pr-7379.surge.sh A11y report: https://patternfly-pr-7379-a11y.surge.sh |
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Timing looks much better. I'm happy if you are @kaylachumley
mcoker
left a comment
There was a problem hiding this comment.
LGTM! I think there is a dupe var block in button unless that's on purpose. Otherwise just little nits.
| --#{$button}--m-favorite__icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default); | ||
| --#{$button}--m-favorite__icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default); | ||
| --#{$button}--m-favorited__icon--AnimationDuration: var(--pf-t--global--motion--duration--icon--long); | ||
| --#{$button}--m-favorited__icon--AnimationTimingFunction: var(--pf-t--global--motion--timing-function--default); |
There was a problem hiding this comment.
Did you mean to include these here as well as in the var list above?
|
|
||
| @keyframes #{$button}-icon-favorited { | ||
| 50% { | ||
| transform: scale(1.5); // make a variable |
There was a problem hiding this comment.
Wanna go ahead and make this a var since it has design approval?
| | `.pf-m-progress` | `.pf-v6-c-button` | Indicates that the button supports the progress state. **Note:** Not used with the plain variation. | | ||
| | `.pf-m-in-progress` | `.pf-v6-c-button` | Indicates that the button is in the in progress state. | | ||
| | `.pf-m-stateful` | `.pf-v6-c-button` | Indicates that the button is used for one of read, unread, and attention states. **Note:** Always use with a modifier of `.pf-m-read`, `.pf-m-unread`, or `.pf-m-attention`. | | ||
| | `.pf-m-notify` | `.pf-v6-c-button` | Indicates that the button should show the user notification of an event. **Note:** This is intended for use with a bell icon in the Notification Badge. | |
There was a problem hiding this comment.
nit
| | `.pf-m-notify` | `.pf-v6-c-button` | Indicates that the button should show the user notification of an event. **Note:** This is intended for use with a bell icon in the Notification Badge. | | |
| | `.pf-m-notify` | `.pf-v6-c-button` | Indicates that the button should show the user notification of an event. **Note:** This is intended for use with a bell icon in the notification badge. | |
|
|
||
| // TODO: standardize icon fitting | ||
| // - Menu item action | ||
| // TODO in breaking change - remove button styling here that is taken care of by favorite button no |
There was a problem hiding this comment.
🧐
| // TODO in breaking change - remove button styling here that is taken care of by favorite button no | |
| // TODO in breaking change - remove button styling here that is taken care of by favorite button now |
| &.pf-m-favorited, | ||
| &.pf-m-favorited:hover, | ||
| &.pf-m-favorited .#{$button} { | ||
| &.pf-m-favorited .#{$button}:not(.pf-m-favorited) { |
There was a problem hiding this comment.
This is fine but we could see if react wants to remove .pf-m-favorited from menu__item-action since it will be on the button now - then we wouldn't need to modify this rule.
|
🎉 This PR is included in version 6.2.0-prerelease.20 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #6601
.pf-m-favoriteadded to button, and then.pf-m-favoritedto indicate that it's been marked as favorite.I also snuck in a docs line for the
.pf-m-notifySeparate commits to do the animation piece, then guard against the old way (in menu and table) and then update examples to use the new way.
Also, I think the table is using the wrong color for the favorite buttons - it uses
--pf-t--global--color--favorite--clickedand I think it should be--pf-t--global--color--favorite--default(but I did not change this current behavior) So you'll see a difference in the icon color since I've switched the examples to use the new button variant.Here's one on the table showing the hover, focused, and un- and then favorited states. You'll see the animation when the buttons is marked as
.pf-m-favorited2025-03-06_15-45-15.mp4