Skip to content

Commit

Permalink
BugFix: Use first-of-type for buttongroup selector (#5343)
Browse files Browse the repository at this point in the history
* BugFix: Use first-of-type for buttongroup selector

* test(vrt): update snapshots

* Create big-jokes-jog.md

---------

Co-authored-by: jonrohan <[email protected]>
  • Loading branch information
jonrohan and jonrohan authored Dec 3, 2024
1 parent d1dc7fa commit 70005b8
Show file tree
Hide file tree
Showing 14 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-jokes-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

BugFix: Fix issue in ButtonGroup Overlay screenshots by updating the selector to use `:is(button, a)` and `:first-of-type` and `:last-of-type` pseudo-classes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/react/src/ButtonGroup/ButtonGroup.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
vertical-align: middle;
isolation: isolate;

& > *:not([data-loading-wrapper]) {
& > *:not([data-loading-wrapper]):is(button, a) {
/* stylelint-disable-next-line primer/spacing */
margin-inline-end: -1px;
position: relative;
border-radius: 0;

&:first-child {
&:first-of-type {
border-top-left-radius: var(--borderRadius-medium);
border-bottom-left-radius: var(--borderRadius-medium);
}

&:last-child {
&:last-of-type {
border-top-right-radius: var(--borderRadius-medium);
border-bottom-right-radius: var(--borderRadius-medium);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/ButtonGroup/ButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ const StyledButtonGroup = toggleStyledComponent(
vertical-align: middle;
isolation: isolate;
&& > *:not([data-loading-wrapper]) {
&& > *:not([data-loading-wrapper]):is(button, a) {
margin-inline-end: -1px;
position: relative;
border-radius: 0;
:first-child {
:first-of-type {
border-top-left-radius: ${get('radii.2')};
border-bottom-left-radius: ${get('radii.2')};
}
:last-child {
:last-of-type {
border-top-right-radius: ${get('radii.2')};
border-bottom-right-radius: ${get('radii.2')};
}
Expand Down

0 comments on commit 70005b8

Please sign in to comment.