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

fix(Button): 🐛 Adjust sizing to match Textfield and other fixes according to Figma #1023

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
29 changes: 11 additions & 18 deletions packages/react/src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
.button {
--fc-button-size: var(--fds-component-mode-height-small);
--fc-button-icon-size: var(--fds-sizing-4);
--fc-button-padding: var(--fds-spacing-1) var(--fds-spacing-2);
--fc-button-padding: 0 var(--fds-spacing-3);
--fc-button-color: var(--fds-semantic-text-action-first-on_action);

display: flex;
align-items: center;
border: var(--fds-border_width-default) solid transparent;
color: var(--fc-button-color);
fill: var(--fc-button-color);
height: var(--fc-button-size);
min-width: var(--fc-button-size);
height: 2.5em;
min-width: 2.5em;
padding: var(--fc-button-padding);
box-sizing: border-box;
cursor: pointer;
font-family: inherit;
justify-content: center;
text-align: center;
letter-spacing: var(--typography-default-letter-spacing);
text-decoration: none;
position: relative;
border-radius: var(--fds-border_radius-interactive);
Expand Down Expand Up @@ -58,32 +56,27 @@
}

.button.small {
--fc-button-size: var(--fds-component-mode-height-small);
--fc-button-padding: var(--fds-spacing-1) var(--fds-spacing-2);
--fc-button-padding: 0 var(--fds-spacing-2);
--fc-button-icon-size: var(--fds-sizing-4);

gap: var(--fds-sizing-2);
font: var(--fds-typography-paragraph-small);
gap: var(--fds-sizing-1);
font: var(--fds-typography-paragraph-short-small);
font-family: inherit;
}

.button.medium {
--fc-button-size: var(--fds-component-mode-height-medium);
--fc-button-padding: var(--fds-spacing-2) var(--fds-spacing-3);
--fc-button-icon-size: var(--fds-sizing-6);

gap: var(--fds-sizing-3);
font: var(--fds-typography-paragraph-medium);
gap: var(--fds-sizing-2);
font: var(--fds-typography-paragraph-short-medium);
font-family: inherit;
}

.button.large {
--fc-button-size: var(--fds-component-mode-height-large);
--fc-button-padding: var(--fds-spacing-2) var(--fds-spacing-3);
--fc-button-icon-size: var(--fds-sizing-8);

gap: var(--fds-sizing-3);
font: var(--fds-typography-paragraph-large);
gap: var(--fds-sizing-2);
font: var(--fds-typography-paragraph-short-large);
font-family: inherit;
}

Expand All @@ -97,7 +90,7 @@
}

.button.onlyIcon {
padding: calc((var(--fc-button-size) - var(--fc-button-icon-size)) / 2 - var(--fds-border_width-default));
padding: 0;
}

/* Only use hover for non-touch devices to prevent sticky-hovering */
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export const WithSpinner: StoryFn<typeof Button> = () => (
<Spinner
variant='interaction'
title='loading'
size='small'
/>
Laster...
</Button>
Expand All @@ -264,6 +265,7 @@ export const WithSpinner: StoryFn<typeof Button> = () => (
<Spinner
variant='interaction'
title='loading'
size='small'
/>
Laster...
</Button>
Expand All @@ -275,6 +277,7 @@ export const WithSpinner: StoryFn<typeof Button> = () => (
<Spinner
variant='interaction'
title='loading'
size='small'
/>
Laster...
</Button>
Expand Down
Loading