Skip to content

Commit b661959

Browse files
authored
refactor(ButtonBase): update selector to have specificty 0,1,0 (#5584)
* refactor(ButtonBase): update selector to have specificty 0,1,0 * chore: add changeset
1 parent 5c33323 commit b661959

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.changeset/slow-nails-reflect.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Update specificity for ButtonBase to be at least 0,1,0

packages/react/src/Button/ButtonBase.module.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Base styles */
2-
:where(.ButtonBase) {
2+
.ButtonBase {
33
display: flex;
44
min-width: max-content;
55
height: var(--control-medium-size);
@@ -54,21 +54,21 @@
5454
}
5555

5656
/* Visuals */
57-
& .Visual {
57+
& :where(.Visual) {
5858
display: flex;
5959
color: var(--fgColor-muted);
6060
pointer-events: none;
6161
}
6262

6363
/* mostly for CounterLabel */
64-
& .VisualWrap {
64+
& :where(.VisualWrap) {
6565
display: flex;
6666
pointer-events: none;
6767
}
6868

6969
/* IconButton */
7070

71-
&.IconButton {
71+
&:where(.IconButton) {
7272
display: inline-grid;
7373
width: var(--control-medium-size);
7474
min-width: unset;
@@ -88,7 +88,7 @@
8888

8989
/* LinkButton */
9090

91-
&[href] {
91+
&:where([href]) {
9292
display: inline-flex;
9393

9494
&:hover {
@@ -98,7 +98,7 @@
9898

9999
/* Button layout */
100100

101-
& .ButtonContent {
101+
& :where(.ButtonContent) {
102102
flex: 1 0 auto;
103103
display: grid;
104104
grid-template-areas: 'leadingVisual text trailingVisual';
@@ -125,7 +125,7 @@
125125
grid-area: leadingVisual;
126126
}
127127

128-
& .Label {
128+
& :where(.Label) {
129129
/* stylelint-disable-next-line primer/typography */
130130
line-height: 1.4285714; /* temporary until we use Text component with --text-body-lineHeight-medium */
131131
white-space: nowrap;

0 commit comments

Comments
 (0)