fix
This commit is contained in:
parent
552fd6d097
commit
554c1cc1df
1 changed files with 36 additions and 46 deletions
|
|
@ -17,8 +17,14 @@
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
align-content: stretch;
|
align-content: stretch;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
column-gap: list.nth($gap, 1);
|
|
||||||
row-gap: list.nth($gap, 2);
|
$columnGap: list.nth($gap, 1);
|
||||||
|
$rowGap: 0;
|
||||||
|
@if list.length($gap) == 2 {
|
||||||
|
$rowGap: list.nth($gap, 2);
|
||||||
|
}
|
||||||
|
column-gap: $columnGap;
|
||||||
|
row-gap: $rowGap;
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
flex: 1 0 auto;
|
flex: 1 0 auto;
|
||||||
|
|
@ -40,59 +46,43 @@
|
||||||
$length: list.length($columns);
|
$length: list.length($columns);
|
||||||
$childs: $length + 'n+' + $i;
|
$childs: $length + 'n+' + $i;
|
||||||
|
|
||||||
& > *:nth-child(#{$i}) {
|
@if math.unit($min) != "" {
|
||||||
@if math.unit($min) == "" and math.unit($max) == "" {
|
@if $direction == 'row' {
|
||||||
flex: $max $min min-content;
|
@if $rowGap > 0 {
|
||||||
} @else if math.unit($min) == "" {
|
$min: calc(#{$min} - #{math.div($rowGap, list.length($columns) - 1)});
|
||||||
flex: 1 $min auto;
|
|
||||||
} @else if math.unit($max) == "" {
|
|
||||||
flex: $max 0 auto;
|
|
||||||
} @else {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
@if math.unit($min) != "" {
|
|
||||||
@if $direction == 'row' {
|
|
||||||
min-width: $min;
|
|
||||||
} @else {
|
|
||||||
min-height: $min;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@if $direction == 'column' {
|
||||||
|
@if $columnGap > 0 {
|
||||||
|
$min: calc(#{$min} - #{math.div($columnGap, list.length($columns) - 1)});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@if math.unit($max) != "" {
|
@if math.unit($max) != "" {
|
||||||
@if $direction == 'row' {
|
@if $direction == 'row' {
|
||||||
max-width: $max;
|
@if $rowGap > 0 {
|
||||||
} @else {
|
$max: calc(#{$max} - #{math.div($rowGap, list.length($columns) - 1)});
|
||||||
max-height: $max;
|
}
|
||||||
|
}
|
||||||
|
@if $direction == 'column' {
|
||||||
|
@if $columnGap > 0 {
|
||||||
|
$max: calc(#{$max} - #{math.div($columnGap, list.length($columns) - 1)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& > *:nth-child(#{$childs}) {
|
& > *:nth-child(#{$childs}) {
|
||||||
@if math.unit($min) == "" and math.unit($max) == "" {
|
flex: $max $min auto;
|
||||||
flex: $max $min min-content;
|
@if $direction == 'row' and $min != 0 {
|
||||||
} @else if math.unit($min) == "" {
|
min-width: $min;
|
||||||
flex: 1 $min auto;
|
} @else if $min > 0 {
|
||||||
} @else if math.unit($max) == "" {
|
min-height: $min;
|
||||||
flex: $max 0 auto;
|
|
||||||
} @else {
|
|
||||||
flex: 1 0 auto;
|
|
||||||
}
|
}
|
||||||
|
@if $direction == 'row' and $max != 0 {
|
||||||
@if math.unit($min) != "" {
|
max-width: $max;
|
||||||
@if $direction == 'row' {
|
} @else if $max > 0 {
|
||||||
min-width: $min;
|
max-height: $max;
|
||||||
} @else {
|
|
||||||
min-height: $min;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@if math.unit($max) != "" {
|
|
||||||
@if $direction == 'row' {
|
|
||||||
max-width: $max;
|
|
||||||
} @else {
|
|
||||||
max-height: $max;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue