Skip to content

fix(buttons): add tokens#6127

Merged
mcoker merged 8 commits into
patternfly:v6from
mcoker:issue-5998-2
Dec 21, 2023
Merged

fix(buttons): add tokens#6127
mcoker merged 8 commits into
patternfly:v6from
mcoker:issue-5998-2

Conversation

@mcoker

@mcoker mcoker commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

fixes #5998

I updated the examples page to (hopefully) make it easier to see the different variations - I'll back those updates out prior to merge

@patternfly-build

patternfly-build commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

@mcoker mcoker force-pushed the issue-5998-2 branch 2 times, most recently from eb3721b to 12eb114 Compare December 13, 2023 19:16
@mcoker mcoker marked this pull request as ready for review December 19, 2023 20:18

@srambach srambach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Couple of quick questions just from the preview:

  • Do we want any space around the inline link for the focus ring? It's really tight.
  • Inline disabled links aren't legible in dark theme - I think it's ultimately getting the on-disabled color rather than the disabled text color?

@thatblindgeye thatblindgeye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In addition to the inline link disabled issue mentioned above, the contrast for the other disabled/aria-disabled buttons is failing in Firefox for both light and dark themes due to the background color


.#{$button} {
// Component
:root {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing the component selector here

@mcoker

mcoker commented Dec 19, 2023

Copy link
Copy Markdown
Contributor Author

@srambach good catch, updated the disabled inline link text/icon colors and added a small outline-offset.

@thatblindgeye I'll leave that for @andrew-ronaldson and @lboehling. As long as the usage of vars all looks correct, I'd say the component should be fine to merge even if we update the contrast of those colors later.

@andrew-ronaldson andrew-ronaldson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Loving the buttons! The only thing that I noticed is the icon button. I remember talking to Lucia about a min-width to match the height so it would be more squared off.
Screenshot 2023-12-20 at 7 49 07 AM

@thatblindgeye thatblindgeye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Had a comment below, but not really blocking. The above comment regarding contrasts could also be a followup.

--#{$button}--m-in-progress--PaddingRight: var(--pf-t--global--spacer--md);
--#{$button}--m-in-progress--PaddingLeft: calc(var(--pf-t--global--spacer--md) + var(--#{$button}__progress--width));
--#{$button}--m-in-progress--m-plain--Color: var(--pf-t--global--color--brand--default);
--#{$button}--m-in-progress--m-plain--Color: var(--#{$spinner}--Color);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: do we want to rely on Spinner's styles here since the other progress button's don't? Just wondering if it'd be confusing that a plain progress button's spinner color would change when the spinner Color var is updated, but none of the other progress button's do. May also be the case that updating the progress--Color var would change the other progress button's spinner color, but not the plain progress button.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@thatblindgeye great question, I just went with the best I could tell based off of the designs.

@andrew-ronaldson per the figma designs, the spinners in progress buttons look to have the same color as an icon in that button would have. So for example, the spinner component in figma uses the color-brand-default token, but in a link button, the spinner uses icon-color-brand-default, which is the same color that an icon in a link button uses.

In v5, we support spinners in plain buttons and the spinner color is just whatever the spinner component color is. So for that support in penta, I'm setting the plain button's spinner color to the spinner default color (color-brand-default). WDYT? I didn't see a plain progress button in figma, though I could have overlooked it if you know of one.

@srambach

Copy link
Copy Markdown
Member

Loving the buttons! The only thing that I noticed is the icon button. I remember talking to Lucia about a min-width to match the height so it would be more squared off. Screenshot 2023-12-20 at 7 49 07 AM

I'd second this for the purposes of target size.

@srambach srambach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside from Andrew's question about min-width and Eric's about the progress spinner color, everything looks good to me. 🚨

@mcoker

mcoker commented Dec 20, 2023

Copy link
Copy Markdown
Contributor Author

@andrew-ronaldson updated! Right now the min-width is set to this math formula based off of the plain button's styles:

1em * {button's line-height} + top padding + bottom padding. Hopefully there's a better way to do this, but that will make the element a square by default, regardless the font-size/padding.

@mcoker

mcoker commented Dec 20, 2023

Copy link
Copy Markdown
Contributor Author

@srambach @thatblindgeye updated the min-width, control variation left/right padding, and confirmed with @andrew-ronaldson the plain spinner color should come from the spinner component (we don't want to set it to anything).

@mcoker

mcoker commented Dec 20, 2023

Copy link
Copy Markdown
Contributor Author

@srambach updated the inline link text properties to inherit. Here's an inline link button in a title component

Screenshot 2023-12-20 at 5 35 47 PM

@srambach srambach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I love the way you've used the fallbacks on the inline-link. ✨

@mcoker mcoker merged commit c34d90d into patternfly:v6 Dec 21, 2023
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.0.0-alpha.43 🎉

The release is available on:

Your semantic-release bot 📦🚀

mattnolting pushed a commit to mattnolting/patternfly that referenced this pull request Jan 2, 2024
mattnolting pushed a commit to mattnolting/patternfly that referenced this pull request Jan 3, 2024
mattnolting pushed a commit to mattnolting/patternfly that referenced this pull request Jan 4, 2024
@mcoker mcoker deleted the issue-5998-2 branch January 7, 2025 16:51
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.

5 participants