Prefix configuable
This commit is contained in:
parent
96d47dc56a
commit
8b4ba286d9
@ -33,44 +33,38 @@
|
||||
@include RV-Alignment--verticalCenter;
|
||||
}
|
||||
|
||||
@mixin RV-Alignment__Container {
|
||||
@mixin RV-Alignment($-prefix: '&') {
|
||||
display: grid;
|
||||
|
||||
&--top {
|
||||
#{$-prefix}--top {
|
||||
@include RV-Alignment--top;
|
||||
}
|
||||
|
||||
&--bottom {
|
||||
#{$-prefix}--bottom {
|
||||
@include RV-Alignment--bottom;
|
||||
}
|
||||
|
||||
&--left {
|
||||
#{$-prefix}--left {
|
||||
@include RV-Alignment--left;
|
||||
}
|
||||
|
||||
&--right {
|
||||
#{$-prefix}--right {
|
||||
@include RV-Alignment--right;
|
||||
}
|
||||
|
||||
&--horizontalCenter {
|
||||
#{$-prefix}--horizontalCenter {
|
||||
@include RV-Alignment--horizontalCenter;
|
||||
}
|
||||
|
||||
&--verticalCenter {
|
||||
#{$-prefix}--verticalCenter {
|
||||
@include RV-Alignment--verticalCenter;
|
||||
}
|
||||
|
||||
&--center {
|
||||
#{$-prefix}--center {
|
||||
@include RV-Alignment--center;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-Alignment {
|
||||
&__Container {
|
||||
@include RV-Alignment__Container;
|
||||
}
|
||||
}
|
||||
|
||||
.RV-Alignment {
|
||||
@include RV-Alignment;
|
||||
}
|
@ -1,63 +1,65 @@
|
||||
@mixin RV-Fan--horizontal($-base_height, $-base_width, $-suffix: '') {
|
||||
@mixin RV-Fan--horizontal($-base_height, $-base_width, $-prefix: '&', $-suffix: '') {
|
||||
|
||||
&__Container#{$-suffix} {
|
||||
#{$-prefix}__Container#{$-suffix} {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
&__Container#{$-suffix} &__Surface {
|
||||
#{$-prefix}__Container#{$-suffix} #{$-prefix}__Surface {
|
||||
min-width: $-base_width;
|
||||
height: $-base_height;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-Fan--vertical($-base_height, $-base_width, $-suffix: '') {
|
||||
&__Container#{$-suffix} {
|
||||
@mixin RV-Fan--vertical($-base_height, $-base_width, $-prefix: '&', $-suffix: '') {
|
||||
#{$-prefix}__Container#{$-suffix} {
|
||||
flex-direction: column;
|
||||
width:max-content;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
&__Container#{$-suffix} &__Surface {
|
||||
#{$-prefix}__Container#{$-suffix} #{$-prefix}__Surface {
|
||||
width: $-base_width;
|
||||
min-height: $-base_height;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-Fan--auto($-base_height, $-base_width, $-suffix: '') {
|
||||
@mixin RV-Fan--auto($-base_height, $-base_width, $-prefix: '&', $-suffix: '') {
|
||||
|
||||
&__Container#{$-suffix} {
|
||||
#{$-prefix}__Container#{$-suffix} {
|
||||
flex-flow: row wrap;
|
||||
}
|
||||
|
||||
&__Container#{$-suffix} &__Surface {
|
||||
#{$-prefix}__Container#{$-suffix} #{$-prefix}__Surface {
|
||||
width: calc(100% - #{$-base_width});
|
||||
min-width: $-base-width;
|
||||
height: $-base_height;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-Fan--fullWidth($-base_height, $-base_width, $-suffix: '') {
|
||||
&__Container#{$-suffix} &__Base, &__Container#{$-suffix} &__Surface {
|
||||
@mixin RV-Fan--fullWidth($-base_height, $-base_width, $-prefix: '&', $-suffix: '') {
|
||||
|
||||
#{$-prefix}__Container#{$-suffix} #{$-prefix}__Base,
|
||||
#{$-prefix}__Container#{$-suffix} #{$-prefix}__Surface {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-Fan ($-base_height, $-base_width) {
|
||||
@include RV-Fan--vertical($-base_height, $-base_width, '--vertical');
|
||||
@include RV-Fan--horizontal($-base_height, $-base_width, '--horizontal');
|
||||
@include RV-Fan--auto($-base_height, $-base_width, '--auto');
|
||||
@include RV-Fan--fullWidth($-base_height, $-base_width, '--fullWidth');
|
||||
@mixin RV-Fan ($-base_height, $-base_width, $-prefix: '&') {
|
||||
@include RV-Fan--vertical($-base_height, $-base_width, $-prefix, '--vertical');
|
||||
@include RV-Fan--horizontal($-base_height, $-base_width, $-prefix, '--horizontal');
|
||||
@include RV-Fan--auto($-base_height, $-base_width, $-prefix, '--auto');
|
||||
@include RV-Fan--fullWidth($-base_height, $-base_width, $-prefix, '--fullWidth');
|
||||
|
||||
&__Container {
|
||||
#{$-prefix}__Container {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
&__Base {
|
||||
#{$-prefix}__Base {
|
||||
height: $-base_height;
|
||||
width: $-base_width;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
&__Surface {
|
||||
#{$-prefix}__Surface {
|
||||
@include RV-ContentCrop;
|
||||
}
|
||||
}
|
||||
|
@ -5,16 +5,16 @@
|
||||
grid-auto-rows: minmax($-item_height, 1fr);
|
||||
}
|
||||
|
||||
@mixin RV-FlexGrid($-item_width: 300px, $-item_height: 300px) {
|
||||
&__Container {
|
||||
@mixin RV-FlexGrid($-item_width: 300px, $-item_height: 300px, $-prefix: '&') {
|
||||
#{$-prefix}__Container {
|
||||
@include RV-FlexGrid__Container($-item_width, $-item_height);
|
||||
}
|
||||
|
||||
&__Item {
|
||||
#{$-prefix}__Item {
|
||||
@include RV-Alignment;
|
||||
}
|
||||
}
|
||||
|
||||
.RV-FlexGrid{
|
||||
.RV-FlexGrid {
|
||||
@include RV-FlexGrid;
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
|
||||
@mixin RV-FlexRow__Container--column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -8,18 +7,40 @@
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Container {
|
||||
display: flex;
|
||||
@mixin RV-FlexRow__Container--horizontal($-break_width: 500px) {
|
||||
flex-direction: row;
|
||||
height: 100%;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&--multiRow {
|
||||
* {
|
||||
flex-basis: calc(#{$-break_width} * 999 - 100% * 999);
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Container--vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
&--column {
|
||||
#{$-prefix}--column {
|
||||
@include RV-FlexRow__Container--column;
|
||||
}
|
||||
|
||||
#{$-prefix}--horizontal {
|
||||
@include RV-FlexRow__Container--horizontal(#{$-break_width});
|
||||
}
|
||||
|
||||
#{$-prefix}--vertical {
|
||||
@include RV-FlexRow__Container--vertical;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Item--normal {
|
||||
@ -41,10 +62,12 @@
|
||||
flex-grow: 4;
|
||||
flex-shrink: 2;
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Item--wider {
|
||||
flex-grow: 5;
|
||||
flex-shrink: 1;
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Item--fixedSize($-width: 100px) {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
@ -52,53 +75,67 @@
|
||||
flex-basis: $-width;
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow__Item {
|
||||
@include RV-Alignment;
|
||||
|
||||
@mixin RV-FlexRow__Item($-prefix: '&') {
|
||||
min-width: min-content;
|
||||
width: 100%;
|
||||
|
||||
&,&--normal {
|
||||
#{$-prefix},
|
||||
#{$-prefix}--normal {
|
||||
@include RV-FlexRow__Item--normal;
|
||||
}
|
||||
}
|
||||
|
||||
&--narrower {
|
||||
@mixin RV-FlexRow__Item--advanced($-prefix: '&') {
|
||||
@include RV-Alignment;
|
||||
|
||||
#{$-prefix}--narrower {
|
||||
@include RV-FlexRow__Item--narrower;
|
||||
}
|
||||
|
||||
&--narrow {
|
||||
#{$-prefix}--narrow {
|
||||
@include RV-FlexRow__Item--narrow;
|
||||
}
|
||||
|
||||
&--wide {
|
||||
#{$-prefix}--wide {
|
||||
@include RV-FlexRow__Item--wide;
|
||||
}
|
||||
|
||||
&--wider {
|
||||
#{$-prefix}--wider {
|
||||
@include RV-FlexRow__Item--wider;
|
||||
}
|
||||
|
||||
&--fixedSize {
|
||||
#{$-prefix}--fixedSize {
|
||||
@include RV-FlexRow__Item--fixedSize;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow--multiRow {
|
||||
&__Container {
|
||||
@mixin RV-FlexRow--multiRow($-prefix: '&') {
|
||||
#{$-prefix}__Container {
|
||||
@include RV-FlexRow__Container--multiRow;
|
||||
}
|
||||
}
|
||||
|
||||
@mixin RV-FlexRow {
|
||||
&__Container {
|
||||
@include RV-FlexRow__Container;
|
||||
@mixin RV-FlexRow($-prefix: '&') {
|
||||
#{$-prefix}__Container {
|
||||
@include RV-FlexRow__Container($-prefix: $-prefix);
|
||||
}
|
||||
|
||||
&__Item {
|
||||
@include RV-FlexRow__Item;
|
||||
#{$-prefix}__Item {
|
||||
@include RV-FlexRow__Item($-prefix: $-prefix);
|
||||
}
|
||||
}
|
||||
|
||||
.RV-FlexRow{
|
||||
@mixin RV-FlexRow--advanced($-break_width: 500px, $-prefix: '&') {
|
||||
#{$-prefix}__Container {
|
||||
@include RV-FlexRow__Container--advanced($-break_width, $-prefix: $-prefix);
|
||||
}
|
||||
|
||||
#{$-prefix}__Item {
|
||||
@include RV-FlexRow__Item--advanced($-prefix: $-prefix);
|
||||
}
|
||||
}
|
||||
|
||||
.RV-FlexRow {
|
||||
@include RV-FlexRow;
|
||||
@include RV-FlexRow--advanced;
|
||||
}
|
@ -7,12 +7,12 @@
|
||||
@include RV-ContentCrop;
|
||||
}
|
||||
|
||||
@mixin RV-FullWidthContent {
|
||||
&__Container {
|
||||
@mixin RV-FullWidthContent($-prefix: '&') {
|
||||
#{$-prefix}__Container {
|
||||
@include RV-FullWidthContent__Container;
|
||||
}
|
||||
|
||||
&__Item {
|
||||
#{$-prefix}__Item {
|
||||
@include RV-FullWidthContent__Item;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user