scss-library/components/01_Layouts/flexRow/_flexRow.scss

141 lines
2.8 KiB
SCSS
Raw Normal View History

2020-08-25 15:53:43 +02:00
@mixin RV-FlexRow__Container--column {
2020-12-27 16:00:24 +01:00
display: flex;
flex-direction: column;
2020-08-25 15:53:43 +02:00
}
@mixin RV-FlexRow__Container--multiRow {
2020-12-27 16:00:24 +01:00
flex-wrap: wrap;
2020-08-25 15:53:43 +02:00
}
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow__Container--horizontal($-break_width: 500px) {
flex-direction: row;
flex-wrap: wrap;
* {
flex-basis: calc(#{$-break_width} * 999 - 100% * 999);
}
}
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow__Container--vertical {
flex-direction: column;
}
2020-08-25 15:53:43 +02:00
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow__Container($-prefix: '&') {
display: flex;
height: 100%;
}
@mixin RV-FlexRow__Container--advanced($-break_width: 500px, $-prefix: '&') {
#{$-prefix}--multiRow {
@include RV-FlexRow__Container--multiRow;
}
#{$-prefix}--column {
@include RV-FlexRow__Container--column;
}
#{$-prefix}--horizontal {
@include RV-FlexRow__Container--horizontal(#{$-break_width});
}
#{$-prefix}--vertical {
@include RV-FlexRow__Container--vertical;
}
2020-08-23 19:20:11 +02:00
}
2020-08-25 15:53:43 +02:00
@mixin RV-FlexRow__Item--normal {
2020-12-27 16:00:24 +01:00
flex-grow: 3;
flex-shrink: 3;
2020-08-25 15:53:43 +02:00
}
@mixin RV-FlexRow__Item--narrower {
2020-12-27 16:00:24 +01:00
flex-grow: 1;
flex-shrink: 5;
2020-08-25 15:53:43 +02:00
}
@mixin RV-FlexRow__Item--narrow {
2020-12-27 16:00:24 +01:00
flex-grow: 2;
flex-shrink: 4;
2020-08-25 15:53:43 +02:00
}
@mixin RV-FlexRow__Item--wide {
2020-12-27 16:00:24 +01:00
flex-grow: 4;
flex-shrink: 2;
2020-08-25 15:53:43 +02:00
}
2020-12-27 16:00:24 +01:00
2020-08-25 15:53:43 +02:00
@mixin RV-FlexRow__Item--wider {
2020-12-27 16:00:24 +01:00
flex-grow: 5;
flex-shrink: 1;
2020-08-25 15:53:43 +02:00
}
2020-12-27 16:00:24 +01:00
2020-08-25 15:53:43 +02:00
@mixin RV-FlexRow__Item--fixedSize($-width: 100px) {
2020-12-27 16:00:24 +01:00
flex-grow: 0;
flex-shrink: 0;
width: min-content;
flex-basis: $-width;
2020-08-25 15:53:43 +02:00
}
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow__Item($-prefix: '&') {
min-width: min-content;
width: 100%;
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix},
#{$-prefix}--normal {
@include RV-FlexRow__Item--normal;
}
}
2020-08-25 15:53:43 +02:00
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow__Item--advanced($-prefix: '&') {
@include RV-Alignment;
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}--narrower {
@include RV-FlexRow__Item--narrower;
}
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}--narrow {
@include RV-FlexRow__Item--narrow;
}
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}--wide {
@include RV-FlexRow__Item--wide;
}
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}--wider {
@include RV-FlexRow__Item--wider;
}
2020-08-23 19:20:11 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}--fixedSize {
@include RV-FlexRow__Item--fixedSize;
}
2020-08-23 19:20:11 +02:00
}
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow--multiRow($-prefix: '&') {
#{$-prefix}__Container {
@include RV-FlexRow__Container--multiRow;
}
}
@mixin RV-FlexRow($-prefix: '&') {
#{$-prefix}__Container {
@include RV-FlexRow__Container($-prefix: $-prefix);
}
#{$-prefix}__Item {
@include RV-FlexRow__Item($-prefix: $-prefix);
}
2020-08-27 15:47:37 +02:00
}
2020-12-27 16:00:24 +01:00
@mixin RV-FlexRow--advanced($-break_width: 500px, $-prefix: '&') {
#{$-prefix}__Container {
@include RV-FlexRow__Container--advanced($-break_width, $-prefix: $-prefix);
}
2020-08-21 16:50:22 +02:00
2020-12-27 16:00:24 +01:00
#{$-prefix}__Item {
@include RV-FlexRow__Item--advanced($-prefix: $-prefix);
}
2020-08-21 16:50:22 +02:00
}
2020-12-27 16:00:24 +01:00
.RV-FlexRow {
@include RV-FlexRow;
@include RV-FlexRow--advanced;
2020-08-21 16:50:22 +02:00
}