Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(button): update button sizes in icon only to have a minimum width #2130

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Changes from all 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
18 changes: 11 additions & 7 deletions src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* TODO: Icon inherits color from the surrounding text, but should use the matching -icon- tokens from below
*/

.button {
position: relative;
border-radius: calc(var(--eds-border-radius-full) * 1px);
Expand Down Expand Up @@ -83,13 +83,14 @@
}

.button--size-lg {
min-width:calc(var(--eds-size-9) / 16 * 1rem);
max-width:calc(var(--eds-size-40) / 16 * 1rem);
min-width: calc(var(--eds-size-9) / 16 * 1rem);
max-width: calc(var(--eds-size-40) / 16 * 1rem);
max-height: calc(var(--eds-size-5) / 16 * 1rem);
}

.button--size-md {
min-width: 3.75rem; /* TODO: missing size token */
/* TODO: missing size token needs to be added to EDS */
min-width: 3.75rem;
max-width: calc(var(--eds-size-32) / 16 * 1rem);
max-height: calc(var(--eds-size-4) / 16 * 1rem);
}
Expand Down Expand Up @@ -123,16 +124,19 @@
.button--lg.button--layout-icon-only {
padding: calc(var(--eds-size-1) / 16 * 1rem);
width: calc(var(--eds-size-5) / 16 * 1rem);
min-width: calc(var(--eds-size-5) / 16 * 1rem);
}

.button--md.button--layout-icon-only {
padding: calc(var(--eds-size-1) / 16 * 1rem);
width: calc(var(--eds-size-4) / 16 * 1rem);
min-width: calc(var(--eds-size-4) / 16 * 1rem);
}

.button--sm.button--layout-icon-only {
padding: calc(var(--eds-size-half) / 16 * 1rem);
width: calc(var(--eds-size-3) / 16 * 1rem);
min-width: calc(var(--eds-size-3) / 16 * 1rem);
}

.button:focus-visible {
Expand Down Expand Up @@ -188,7 +192,7 @@

.button--tertiary.button--variant-critical {
color: var(--eds-theme-color-background-utility-critical-high-emphasis);
border-color: var(--eds-theme-color-background-utility-inverse-high-emphasis);
border-color: var(--eds-theme-color-background-utility-inverse-high-emphasis);
}

.button--primary.button--variant-neutral {
Expand Down Expand Up @@ -276,7 +280,7 @@
&.button--primary.button--variant-neutral {
color: var(--eds-theme-color-text-utility-disabled-primary);
border-color: var(--eds-theme-color-background-utility-disabled-medium-emphasis);
background-color: var(--eds-theme-color-background-utility-disabled-medium-emphasis);
background-color: var(--eds-theme-color-background-utility-disabled-medium-emphasis);
}

&.button--primary.button--variant-inverse {
Expand Down Expand Up @@ -327,7 +331,7 @@
* States
*/

/* Hover */
/* Hover */
.button--variant-default:hover {
background-color: var(--eds-theme-color-border-utility-interactive-hover);
border-color: var(--eds-theme-color-border-utility-interactive-hover);
Expand Down