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

fix(styles): wrap button group overflow #3062

Merged
merged 10 commits into from
Jun 18, 2024
5 changes: 5 additions & 0 deletions .changeset/yellow-spies-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Implemented button wrapping for overflow in button groups.
20 changes: 4 additions & 16 deletions packages/styles/src/components/button-group.scss
alizedebray marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,19 @@

@use './../mixins/utilities';
@use './../variables/color';
@use './../variables/spacing';
@use './../variables/components/button';
@use './../variables/components/forms';

.btn-group {
max-width: 100%;
flex-wrap: wrap;
row-gap: spacing.$size-micro;

> .btn {
white-space: normal;
cursor: pointer;

// added a transition delay on the "z-index" so the button only moves back after all other transitions
z-index: 0;
transition:
z-index 0s ease (0.5 * button.$btn-transition-duration),
button.$btn-transition;

@include utilities.high-contrast-mode() {
transition: none !important;
}
}

> .btn:hover {
// remove the transition delay on the "z-index" for all raised states so the button moves forward before other transitions
z-index: 2 !important;
transition: button.$btn-transition;
flex: 0 1 auto;
}

> .btn-secondary {
Expand Down