Rewrote SCSS Structure, Improvement

This commit is contained in:
reverend 2020-08-23 14:39:45 +02:00
parent 8ebb44e3ba
commit 7eeaaff40c
2 changed files with 80 additions and 21 deletions

View File

@ -1,34 +1,65 @@
@mixin RV-Fan ($base_height, $base_width) { @mixin RV-Fan--horizontal($-base_height, $-base_width, $-suffix: '') {
&__Container {
display: flex;
&--horizontal { &__Container#{$-suffix} {
flex-direction: row; flex-direction: row;
} }
&--vertical { &__Container#{$-suffix} &__Surface {
flex-direction: column; min-width: $-base_width;
width:max-content; height: $-base_height;
} }
} }
@mixin RV-Fan--vertical($-base_height, $-base_width, $-suffix: '') {
&__Container#{$-suffix} {
flex-direction: column;
width:max-content;
}
&__Container#{$-suffix} &__Surface {
width: $-base_width;
min-height: $-base_height;
}
}
@mixin RV-Fan--auto($-base_height, $-base_width, $-suffix: '') {
&__Container#{$-suffix} {
flex-flow: row wrap;
}
&__Container#{$-suffix} &__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 {
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');
&__Container {
display: flex;
}
&__Base { &__Base {
height: $base_height; height: $-base_height;
width: $base_width; width: $-base_width;
flex: 0 0 auto; flex: 0 0 auto;
} }
&__Surface { &__Surface {
@include RV-ContentCrop; @include RV-ContentCrop;
} }
&__Container--horizontal &__Surface {
height: $base_height;
}
&__Container--vertical &__Surface {
width: $base_width;
}
} }
.RV-Fan { .RV-Fan {

View File

@ -1,4 +1,32 @@
<div class="RV-Fan__Container RV-Fan__Container--horizontal RV-Fan__Container--realFan"> <div class="RV-Fan__Container RV-Fan__Container--horizontal">
<div class="red RV-Fan__Base"></div>
<div class="green RV-Fan__Surface">
<p>Some content here</p>
<p>More conthent over here</p>
<p>Et voluptas earum ut. Distinctio qui eaque quo aliquid ipsam ut. Et est sit sed odio aliquam nam. Possimus numquam officiis tenetur quibusdam sint quos sit est. Doloremque hic totam error velit hic. Dolorum labore necessitatibus cumque quisquam voluptate molestiae quae aspernatur.
Quasi vitae cupiditate ducimus nihil. Repudiandae est iste aperiam mollitia et est occaecati at. Nobis ut voluptates tempora quis esse ipsam.
Praesentium facere ea deserunt accusantium velit eos. Eaque non sapiente repellendus facilis omnis eligendi. Deserunt officiis consequatur nihil maiores explicabo. Perspiciatis qui quia et amet.</p>
</div>
</div>
<br><br>
<div class="RV-Fan__Container RV-Fan__Container--auto">
<div class="red RV-Fan__Base"></div>
<div class="green RV-Fan__Surface">
<p>Some content here</p>
<p>More conthent over here</p>
<p>Et voluptas earum ut. Distinctio qui eaque quo aliquid ipsam ut. Et est sit sed odio aliquam nam. Possimus numquam officiis tenetur quibusdam sint quos sit est. Doloremque hic totam error velit hic. Dolorum labore necessitatibus cumque quisquam voluptate molestiae quae aspernatur.
Quasi vitae cupiditate ducimus nihil. Repudiandae est iste aperiam mollitia et est occaecati at. Nobis ut voluptates tempora quis esse ipsam.
Praesentium facere ea deserunt accusantium velit eos. Eaque non sapiente repellendus facilis omnis eligendi. Deserunt officiis consequatur nihil maiores explicabo. Perspiciatis qui quia et amet.</p>
</div>
</div>
<br><br>
<div class="RV-Fan__Container RV-Fan__Container--auto RV-Fan__Container--fullWidth">
<div class="red RV-Fan__Base"></div> <div class="red RV-Fan__Base"></div>
<div class="green RV-Fan__Surface"> <div class="green RV-Fan__Surface">
<p>Some content here</p> <p>Some content here</p>