Improve the flex-group component.

This commit is contained in:
Fredrik Jonsson 2024-01-30 19:36:44 +01:00
commit 8e5f7c54c7
2 changed files with 23 additions and 16 deletions

View file

@ -8,8 +8,15 @@
& > * {
flex: 1;
flex-basis: 100%;
flex-grow: 0;
}
&--grow {
flex-grow: 1;
}
@include respond-to(s) {
&--2 > * {
@include flex(2, $gap);
}
@ -29,4 +36,5 @@
&--6 > * {
@include flex(6, $gap);
}
}
}

View file

@ -1,4 +1,3 @@
@mixin flex($c, $x) {
flex-basis: calc(100% / #{$c} - #{$x * $base-line-height + 'rem'});
flex-grow: 0;
@mixin flex($col, $gap) {
flex-basis: calc(100% / #{$col} - #{$gap * $base-line-height + 'rem'});
}