Skip to content

Button - add favorite variant #11809

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

Open
mcoker opened this issue May 6, 2025 · 3 comments · May be fixed by #11853
Open

Button - add favorite variant #11809

mcoker opened this issue May 6, 2025 · 3 comments · May be fixed by #11853
Assignees
Milestone

Comments

@mcoker
Copy link
Contributor

mcoker commented May 6, 2025

Main core PR - patternfly/patternfly#7379
Animate between filled/unfilled icon PR - patternfly/patternfly#7492

TL;DR:

  • Adds .pf-m-favorite as the class that always needs to be on a favorite button
  • Adds .pf-m-favorited that toggles a .pf-m-favorite button between favorited/not-favorited
  • Inside of the button__icon container, adds 2 new elements that both need to be rendered at the same time. CSS hides/shows the correct icon.
    • button__icon-favorite - this will hold <OutlinedStarIcon>, for the non-favorited state
    • button__icon-favorited - this will hold <StarIcon>, for the favorited state

Toggling .pf-m-favorited sets the appropriate colors and swaps the visibility of the star and outlined star icons

@andrew-ronaldson @srambach are there any limitations to which kind of button this should apply to? Technically it could apply to any button, though there may be color contrast issues if the button doesn't have a transparent background - so all buttons except primary, warning, and danger. Or is this only intended to be used with plain buttons?

@andrew-ronaldson
Copy link
Collaborator

I think just the plain button and plain no padding are a good start. Favouriting shouldn't be in any of the pills

@srambach srambach added this to the 2025.Q2 milestone May 8, 2025
@srambach srambach moved this from Needs triage to Backlog in PatternFly Issues May 8, 2025
@srambach srambach moved this from Backlog to Ready to assign in PatternFly Issues May 20, 2025
@thatblindgeye
Copy link
Contributor

As part of this we should also update the FavoriteCell component in the react-table package

@Mash707
Copy link
Contributor

Mash707 commented May 21, 2025

@thatblindgeye I would like to work on this, could assign this to me. Thank You

@thatblindgeye thatblindgeye moved this from Ready to assign to Not started in PatternFly Issues May 27, 2025
@Mash707 Mash707 linked a pull request May 28, 2025 that will close this issue
@thatblindgeye thatblindgeye moved this from Not started to In Progress in PatternFly Issues May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

5 participants