Skip to content

Commit

Permalink
fix(sbb-container, sbb-tab-group): avoid reserving invisible space
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB committed Jul 10, 2024
1 parent 46e4771 commit d71cdc4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
29 changes: 25 additions & 4 deletions src/elements/container/container/container.visual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ describe(`sbb-container`, () => {
<sbb-secondary-button style="margin-block-end: 3rem;">See more</sbb-secondary-button>
`;

const wrapperStyles = { backgroundColor: 'var(--sbb-color-silver)', padding: '0' };

describeViewports({ viewportHeight: 600 }, () => {
for (const color of colorCases) {
it(
`color=${color}`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html` <sbb-container color=${color}> ${containerContent()} </sbb-container> `,
{ backgroundColor: 'var(--sbb-color-silver)', padding: '0' },
html`<sbb-container color=${color}>${containerContent()}</sbb-container>`,
wrapperStyles,
);
}),
);
Expand All @@ -42,8 +44,27 @@ describe(`sbb-container`, () => {
`expanded`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html` <sbb-container expanded> ${containerContent()} </sbb-container> `,
{ backgroundColor: 'var(--sbb-color-silver)', padding: '0' },
html`<sbb-container expanded>${containerContent()}</sbb-container>`,
wrapperStyles,
);
}),
);
});

describeViewports({ viewports: ['medium'] }, () => {
it(
`nested`,
visualDiffDefault.with(async (setup) => {
await setup.withFixture(
html`
<sbb-container color="white">
${containerContent()}
<div style="background-color: var(--sbb-color-milk);">
<sbb-container color="transparent">${containerContent()}</sbb-container>
</div>
</sbb-container>
`,
wrapperStyles,
);
}),
);
Expand Down
1 change: 1 addition & 0 deletions src/elements/core/styles/mixins/helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
display: block;
visibility: hidden;
height: 0;
overflow: hidden;
}
}

Expand Down

0 comments on commit d71cdc4

Please sign in to comment.