Skip to content

Conversation

@broccolinisoup
Copy link
Member

@broccolinisoup broccolinisoup commented Jul 8, 2024

Closes #4129

Changelog

New

Changed

  • With this PR, we are wrapping button group items with a div. The main reason is to simplify CSS selection. You can view the previous attempt to write a CSS to fix styling issues both for tooltip v1 and v2 on button group.
  • Enhanced CSS selection for the ButtonGroup children elements to ensure buttons and links still look the same if there are tooltips on them

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2024

🦋 Changeset detected

Latest commit: 08df44e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@broccolinisoup broccolinisoup changed the title tooltip button group styling fix ButtonGroup: Fix button and icon button styling when tooltips are used on them Jul 8, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.49 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 92.72 KB (+0.05% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4723 July 8, 2024 01:20 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4723 July 11, 2024 03:40 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4723 July 11, 2024 04:31 Inactive
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/332533

@broccolinisoup broccolinisoup marked this pull request as ready for review July 11, 2024 05:27
@broccolinisoup broccolinisoup requested review from a team as code owners July 11, 2024 05:27
@github-actions github-actions bot temporarily deployed to storybook-preview-4723 July 11, 2024 05:31 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-4723 July 16, 2024 05:14 Inactive
Copy link
Contributor

@mperrotti mperrotti left a comment

Choose a reason for hiding this comment

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

Looks great! I just made some suggestions to simplify the styling a little.

Just confirm that my suggestions actually work and then I'll approve.

name: 'Icon Buttons',
},
{
id: 'components-buttongroup-features--icon-buttons-with-tooltip',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the new way we prefer to create VRTs? I've been manually editing the .test.ts files 😅

isolation: isolate;
&& > * {
&& :is(button, a) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't actually think we need :is for this. I think we can just select button and a directly

Suggested change
&& :is(button, a) {
button,
a {

}
${sx};
&& > :first-child :is(button, a) {
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 - I don't think we need && or :is, we can just directly select button and a children of :first-child

Suggested change
&& > :first-child :is(button, a) {
> :first-child button,
> :first-child a {

border-bottom-left-radius: ${get('radii.2')};
}
&& > :last-child :is(button, a) {
Copy link
Contributor

Choose a reason for hiding this comment

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

One more :)

Suggested change
&& > :last-child :is(button, a) {
> :last-child button,
> :last-child a {

@github-actions
Copy link
Contributor

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@broccolinisoup
Copy link
Member Author

closing in favour of #5123

@jonrohan jonrohan deleted the tooltip-button-group-styling-fix branch May 9, 2025 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using <Tooltip> within <ButtonGroup> affects styling

3 participants