Skip to content

feat(Button): added circle variant#7922

Merged
mcoker merged 6 commits into
patternfly:mainfrom
thatblindgeye:iss7913_circleButton
Oct 27, 2025
Merged

feat(Button): added circle variant#7922
mcoker merged 6 commits into
patternfly:mainfrom
thatblindgeye:iss7913_circleButton

Conversation

@thatblindgeye

@thatblindgeye thatblindgeye commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Closes #7913

The small variant paired with circle buttons looks like it breaks the small styling and it would also break the large/CTA styling, let me know if we would want small and/or large + circle to have decreased/increased padding respectively

@thatblindgeye thatblindgeye requested a review from mcoker October 23, 2025 12:52
@patternfly-build

patternfly-build commented Oct 23, 2025

Copy link
Copy Markdown
Collaborator

@mcoker

mcoker commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

These buttons also need larger icons. We used --pf-t--global--icon--size--font--lg (18px) in the POC. That may be difficult to do using standard spacers and managing to maintain the same size (37x37) unless there is some trick?

A couple of ways I can think of doing it off the top of my head:

  • You could scale the __icon element so it's 18px (~1.2857142857). That isn't the best because it has the potential to distort the icon, but it isn't a large scale so IMO it's fine and that would be easy since it won't change the button shape. I'd probably do this.
  • You can try adjusting the font-size, then manipulating line-height to match the default/14px line-height to get the height in check, then adjust --pf-v6-c-button--MinWidth so that's based off of the default/14px size, too. This will probably create vertical alignment issues when buttons are side by side (just siblings - not in a flex layout).
  • You could opt out of padding on the button and just make the width/height 37px based off of the default button padding and font-size and everything (like width: (padding-top) + (padding-bottom) + 1lh), then use flex or grid on the button to center the icon element and change the font-size of the icon element. I wouldn't do this, it seems fragile, but it's an option.

@thatblindgeye

Copy link
Copy Markdown
Contributor Author

@mcoker went the scale route for now, using 1.29 just to keep the value short and it's the closest to 18px (0.06 over, vs 1.28 scale being 0.08 under).

Comment on lines +379 to +382
--#{$button}--m-circle--PaddingBlockStart: var(--pf-t--global--spacer--control--vertical--default);
--#{$button}--m-circle--PaddingInlineEnd: var(--pf-t--global--spacer--control--horizontal--compact);
--#{$button}--m-circle--PaddingBlockEnd: var(--pf-t--global--spacer--control--vertical--default);
--#{$button}--m-circle--PaddingInlineStart: var(--pf-t--global--spacer--control--horizontal--compact);

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.

I don't think --compact is the right padding to use for the inline variants. While it gives you the correct spacer, it may not forever if we update the compact spacer to be something else.

Since the min-width will always make these buttons a square, I might just leave the inline spacers off? Or have them reference the top/bottom spacers? I would probably just remove them since the min-width's role is to make it at least a square.

@mcoker mcoker 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.

💪🤖👍

@mcoker mcoker merged commit 9f4c365 into patternfly:main Oct 27, 2025
4 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

edonehoo pushed a commit to edonehoo/patternfly that referenced this pull request Nov 11, 2025
* feat(Button): added circle variant

* Added aria

* feat(Button): updated to beta

* feat(Button): added circle styling to menu toggle

* feat(Button): added scale to circle icon

* feat(Button): updated inline paddings to 0

---------

Co-authored-by: Eric Olkowski <git.eric@thatblindgeye.dev>
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.

Button - add variation for circle buttons with less padding and larger icons

3 participants