diff --git a/scss/_buttons.scss b/scss/_buttons.scss index edaaf2c225..38ddf95fd3 100644 --- a/scss/_buttons.scss +++ b/scss/_buttons.scss @@ -90,7 +90,7 @@ // End mod // Boosted mod: with icon - &:not(.btn-icon) > svg { + &:not(.btn-icon):not(.btn-sm) > svg { transform: translateY(1px); } // End mod @@ -256,6 +256,11 @@ // Boosted mod: icon button .btn-icon { padding: var(--#{$prefix}icon-spacing); + + &.btn-sm { + padding-right: $btn-icon-padding-x-sm + .0625rem; + padding-bottom: $btn-icon-padding-x-sm + .0625rem; + } } // End mod diff --git a/scss/_variables.scss b/scss/_variables.scss index 09aa0961c1..c5f8ef2e5e 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -977,13 +977,13 @@ $btn-letter-spacing: $letter-spacing-base !default; // Boosted mod $btn-white-space: null !default; // Set to `nowrap` to prevent text wrapping $btn-padding-y-sm: $input-btn-padding-y-sm !default; -$btn-padding-x-sm: $input-btn-padding-x-sm !default; +$btn-padding-x-sm: $spacer * .65 !default; // Boosted mod $btn-font-size-sm: $input-btn-font-size-sm !default; $btn-line-height-sm: $line-height-sm !default; // Boosted mod $btn-letter-spacing-sm: $letter-spacing-base !default; // Boosted mod $btn-padding-y-lg: $input-btn-padding-y-lg !default; -$btn-padding-x-lg: $input-btn-padding-x-lg !default; +$btn-padding-x-lg: $spacer * .9 !default; // Boosted mod $btn-font-size-lg: $input-btn-font-size-lg !default; $btn-line-height-lg: $h5-line-height !default; // Boosted mod $btn-letter-spacing-lg: $letter-spacing-base * 2 !default; // Boosted mod diff --git a/site/content/docs/5.3/components/buttons.md b/site/content/docs/5.3/components/buttons.md index fd387ea5be..45c0b4521a 100644 --- a/site/content/docs/5.3/components/buttons.md +++ b/site/content/docs/5.3/components/buttons.md @@ -62,29 +62,29 @@ Please refer to the [Buttons](https://system.design.orange.com/0c1af118d/p/278eb The recommended way of using an icon in a button is [an embedded SVG]({{< docsref "/extend/icons" >}}). You need to: -- set its dimensions to `1.25rem` to match button size—except for `.btn-sm` where you should use `1rem`, +- set its dimensions to `1.25rem` to match button size—except for `.btn-sm` where you should use `.9375rem`, - apply `.me-1` on it to get consistent spacing, - fill it using `currentColor` to respect button color scheme, - finally add `.overflow-visible` utility to prevent SVG content from being cropped. {{< example >}} {{< /example >}} @@ -94,22 +94,35 @@ Add `.btn-icon` to get a squared button, meant to only contain an icon. Make sur {{< example >}} + + +
{{< /example >}} @@ -119,22 +132,22 @@ Use `.btn-no-outline` to get a borderless button as default state, and a consist {{< example >}} {{< /example >}} diff --git a/site/content/docs/5.3/migration.md b/site/content/docs/5.3/migration.md index 656deb3476..c20e63e12c 100644 --- a/site/content/docs/5.3/migration.md +++ b/site/content/docs/5.3/migration.md @@ -739,6 +739,9 @@ Color mode mechanism coming from Bootstrap is available from Boosted v5.3.0. How - New Outlined button `.btn-outline-secondary` is now provided. It is basically `.btn-secondary` with default transparent background. - New TikTok social button. +- **Buttons** + - Warning Change icons size in small buttons from `1rem` to `.9375rem`. + - **Cards** - Cards now have a `color` set on them to improve rendering across color modes.