diff --git a/.changeset/polite-radios-train.md b/.changeset/polite-radios-train.md new file mode 100644 index 0000000000..ce58fbf98e --- /dev/null +++ b/.changeset/polite-radios-train.md @@ -0,0 +1,5 @@ +--- +"@swisspost/design-system-styles": patch +--- + +Update button styles: padding, gap and border-radius. diff --git a/packages/styles/src/mixins/_button.scss b/packages/styles/src/mixins/_button.scss index ee8dae85b0..981febd91e 100644 --- a/packages/styles/src/mixins/_button.scss +++ b/packages/styles/src/mixins/_button.scss @@ -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); diff --git a/packages/styles/src/variables/_commons.scss b/packages/styles/src/variables/_commons.scss index 0f994b8f29..26d61107c8 100644 --- a/packages/styles/src/variables/_commons.scss +++ b/packages/styles/src/variables/_commons.scss @@ -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; diff --git a/packages/styles/src/variables/components/_button.scss b/packages/styles/src/variables/components/_button.scss index 53bfc16950..4770c034ef 100644 --- a/packages/styles/src/variables/components/_button.scss +++ b/packages/styles/src/variables/components/_button.scss @@ -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; @@ -48,8 +49,9 @@ $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; @@ -57,8 +59,9 @@ $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; @@ -66,12 +69,13 @@ $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; @@ -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,