Improve the flex-group component.
This commit is contained in:
parent
f7245000d0
commit
8e5f7c54c7
2 changed files with 23 additions and 16 deletions
|
|
@ -8,8 +8,15 @@
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
flex-basis: 100%;
|
||||||
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--grow {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include respond-to(s) {
|
||||||
&--2 > * {
|
&--2 > * {
|
||||||
@include flex(2, $gap);
|
@include flex(2, $gap);
|
||||||
}
|
}
|
||||||
|
|
@ -29,4 +36,5 @@
|
||||||
&--6 > * {
|
&--6 > * {
|
||||||
@include flex(6, $gap);
|
@include flex(6, $gap);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
@mixin flex($c, $x) {
|
@mixin flex($col, $gap) {
|
||||||
flex-basis: calc(100% / #{$c} - #{$x * $base-line-height + 'rem'});
|
flex-basis: calc(100% / #{$col} - #{$gap * $base-line-height + 'rem'});
|
||||||
flex-grow: 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue