Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ButtonBase): update selector to have specificty 0,1,0 #5584

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slow-nails-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Update specificity for ButtonBase to be at least 0,1,0
14 changes: 7 additions & 7 deletions packages/react/src/Button/ButtonBase.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Base styles */
:where(.ButtonBase) {
.ButtonBase {
display: flex;
min-width: max-content;
height: var(--control-medium-size);
Expand Down Expand Up @@ -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;
Expand All @@ -88,7 +88,7 @@

/* LinkButton */

&[href] {
&:where([href]) {
display: inline-flex;

&:hover {
Expand All @@ -98,7 +98,7 @@

/* Button layout */

& .ButtonContent {
& :where(.ButtonContent) {
joshblack marked this conversation as resolved.
Show resolved Hide resolved
flex: 1 0 auto;
display: grid;
grid-template-areas: 'leadingVisual text trailingVisual';
Expand All @@ -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;
Expand Down
Loading