From 41c9ae02bc91e7dae795cfc460924ef766fc0bb4 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 21 Jan 2025 15:39:12 -0600 Subject: [PATCH 1/2] refactor(ButtonBase): update selector to have specificty 0,1,0 --- packages/react/src/Button/ButtonBase.module.css | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react/src/Button/ButtonBase.module.css b/packages/react/src/Button/ButtonBase.module.css index 00c49d97207..24bf4e0b8ea 100644 --- a/packages/react/src/Button/ButtonBase.module.css +++ b/packages/react/src/Button/ButtonBase.module.css @@ -1,5 +1,5 @@ /* Base styles */ -:where(.ButtonBase) { +.ButtonBase { display: flex; min-width: max-content; height: var(--control-medium-size); @@ -54,21 +54,21 @@ } /* Visuals */ - & .Visual { + & :where(.Visual) { display: flex; color: var(--fgColor-muted); pointer-events: none; } /* mostly for CounterLabel */ - & .VisualWrap { + & :where(.VisualWrap) { display: flex; pointer-events: none; } /* IconButton */ - &.IconButton { + &:where(.IconButton) { display: inline-grid; width: var(--control-medium-size); min-width: unset; @@ -88,7 +88,7 @@ /* LinkButton */ - &[href] { + &:where([href]) { display: inline-flex; &:hover { @@ -98,7 +98,7 @@ /* Button layout */ - & .ButtonContent { + & :where(.ButtonContent) { flex: 1 0 auto; display: grid; grid-template-areas: 'leadingVisual text trailingVisual'; @@ -125,7 +125,7 @@ grid-area: leadingVisual; } - & .Label { + & :where(.Label) { /* stylelint-disable-next-line primer/typography */ line-height: 1.4285714; /* temporary until we use Text component with --text-body-lineHeight-medium */ white-space: nowrap; From c0cbbd4a3abf1f8642de9a7eaae3628fab0e0af3 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Tue, 21 Jan 2025 15:48:03 -0600 Subject: [PATCH 2/2] chore: add changeset --- .changeset/slow-nails-reflect.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/slow-nails-reflect.md diff --git a/.changeset/slow-nails-reflect.md b/.changeset/slow-nails-reflect.md new file mode 100644 index 00000000000..3b234569101 --- /dev/null +++ b/.changeset/slow-nails-reflect.md @@ -0,0 +1,5 @@ +--- +"@primer/react": patch +--- + +Update specificity for ButtonBase to be at least 0,1,0