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

feat(styles): update buttons padding, gap and border-radius #1666

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/polite-radios-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swisspost/design-system-styles": patch
---

Update button styles: padding, gap and border-radius.
2 changes: 1 addition & 1 deletion packages/styles/src/mixins/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@mixin button-size($size: md) {
min-height: map.get(button.$btn-height-map, $size);
font-size: map.get(button.$btn-font-size-map, $size);
gap: map.get(button.$btn-padding-x-map, $size) * 0.5;
gap: map.get(button.$btn-gap-x-map, $size);

&:where(:not(.btn-link, .btn-tertiary)) {
padding: 0 map.get(button.$btn-padding-x-map, $size);
Expand Down
2 changes: 1 addition & 1 deletion packages/styles/src/variables/_commons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $border-width: 1px !default;
$border-thick: 2px !default;
$border-color: color.$gray-20 !default;

$border-radius: 3px !default;
$border-radius: 4px !default;
$border-radius-sm: $border-radius !default;
$border-radius-rg: $border-radius !default;
$border-radius-lg: $border-radius !default;
Expand Down
26 changes: 18 additions & 8 deletions packages/styles/src/variables/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ $btn-animation-distance-factor: 0.5 !default;

// sm
$btn-padding-y-sm: spacing.$size-mini !default;
$btn-padding-x-sm: spacing.$size-regular !default;
$btn-padding-x-sm: sizing.px-to-rem(12) !default;
$btn-gap-x-sm: sizing.px-to-rem(6) !default;
$btn-animation-distance-sm: spacing.$size-mini !default;
// Design System only
$btn-height-sm: 2rem;
Expand All @@ -48,30 +49,33 @@ $btn-icon-size-sm: spacing.$size-regular !default;

// rg
$btn-padding-y-rg: spacing.$size-small-regular !default;
$btn-padding-x-rg: spacing.$size-large !default;
$btn-animation-distance-rg: 0.625rem !default;
$btn-padding-x-rg: sizing.px-to-rem(14) !default;
$btn-gap-x-rg: sizing.px-to-rem(8) !default;
$btn-animation-distance-rg: spacing.$size-mini !default;
// Design System only
$btn-height-rg: 2.5rem;
$btn-font-size-rg: type.$font-size-14 !default;
$btn-icon-size-rg: 1.125rem !default;

// md
$btn-padding-y-md: spacing.$size-regular !default;
$btn-padding-x-md: spacing.$size-big !default;
$btn-animation-distance-md: spacing.$size-small-regular !default;
$btn-padding-x-md: sizing.px-to-rem(16) !default;
$btn-gap-x-md: sizing.px-to-rem(10) !default;
$btn-animation-distance-md: spacing.$size-mini !default;
// Design System only
$btn-height-md: 3rem;
$btn-font-size-md: type.$font-size-16 !default;
$btn-icon-size-md: spacing.$size-small-large !default;

// lg
$btn-padding-y-lg: spacing.$size-small-large !default;
$btn-padding-x-lg: spacing.$size-bigger-big !default;
$btn-animation-distance-lg: spacing.$size-regular !default;
$btn-padding-x-lg: sizing.px-to-rem(18) !default;
$btn-gap-x-lg: sizing.px-to-rem(12) !default;
$btn-animation-distance-lg: spacing.$size-mini !default;
// Design System only
$btn-height-lg: 3.5rem;
$btn-font-size-lg: type.$font-size-18 !default;
$btn-icon-size-lg: spacing.$size-large !default;
$btn-icon-size-lg: 1.375rem !default;

// Available button sizes except the default, which is md
$btn-non-default-sizes: sm, rg, lg !default;
Expand All @@ -94,6 +98,12 @@ $btn-padding-x-map: (
'md': $btn-padding-x-md,
'lg': $btn-padding-x-lg,
);
$btn-gap-x-map: (
'sm': $btn-gap-x-sm,
'rg': $btn-gap-x-rg,
'md': $btn-gap-x-md,
'lg': $btn-gap-x-lg,
);
$btn-height-map: (
'sm': $btn-height-sm,
'rg': $btn-height-rg,
Expand Down
Loading