Skip to content

Commit

Permalink
fix(sbb-button): fix gap between icon and text for size s (#2678)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons authored May 23, 2024
1 parent b4a2006 commit 38efbd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/button/button/button.snapshot.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(`sbb-button`, () => {
};

// 'l' as default is covered by other cases.
const sizeCases = { size: ['s', 'm'] };
const sizeCases = { size: ['s', 'm'], icon: [undefined, 'arrow-right-small'] };

describeViewports({ viewports: ['zero', 'medium'] }, () => {
describeEach(cases, ({ disabled, negative, state }) => {
Expand All @@ -50,10 +50,10 @@ describe(`sbb-button`, () => {
visualRegressionSnapshot(() => root);
});

describeEach(sizeCases, ({ size }) => {
describeEach(sizeCases, ({ size, icon }) => {
beforeEach(async function () {
root = await visualRegressionFixture(
html`<sbb-button size=${size}>Button</sbb-button>`,
html`<sbb-button size=${size} .iconName=${icon}>Button</sbb-button>`,
this,
);
});
Expand Down
1 change: 1 addition & 0 deletions src/components/button/common/button-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ $icon-only: ':where([data-slot-names~=icon], [icon-name]):not([data-slot-names~=
:host([size='s']) {
--sbb-button-min-height: var(--sbb-size-element-xs);
--sbb-button-padding-inline: var(--sbb-spacing-fixed-4x);
--sbb-button-gap: var(--sbb-spacing-fixed-1x);

@include sbb.mq($from: medium) {
--sbb-button-padding-inline: var(--sbb-spacing-fixed-5x);
Expand Down

0 comments on commit 38efbd8

Please sign in to comment.