scss-library/components/02_Styles/spacing/_spacing.scss

99 lines
2.0 KiB
SCSS
Raw Normal View History

2021-01-02 20:31:02 +01:00
@use "sass:meta";
2020-08-23 11:35:47 +02:00
@mixin RV-Spacing__Outer--small {
margin: $-spacing-small;
}
@mixin RV-Spacing__Outer--medium {
margin: $-spacing-medium;
}
@mixin RV-Spacing__Outer--large {
margin: $-spacing-large;
}
2021-01-02 20:31:02 +01:00
@mixin _flexrow_breakpoint_min_width($-gap) {
@include RV-Utils__Hook--catch {
$-breakpoint: get-hook-value('breakPoint');
@include RV-Utils__ElementAmount using($-index) {
min-width: calc((#{$-breakpoint} - (#{$-gap} * (#{$-index} - 1))) / #{$-index} - (2 * #{$-gap}));
* {
min-width: initial;
}
}
}
}
@mixin _flexgrid_masonry_column_gap($-gap) {
2020-08-23 11:35:47 +02:00
2021-01-02 20:31:02 +01:00
@include RV-Utils__Hook--catch {
* {
margin: $-gap/2 0;
}
}
}
@mixin RV-Spacing__Inner--small() {
padding: $-spacing-small;
gap: $-spacing-small;
column-gap: $-spacing-small;
@include _flexrow_breakpoint_min_width($-spacing-small);
@include _flexgrid_masonry_column_gap($-spacing-small);
2020-08-23 11:35:47 +02:00
}
2021-01-02 20:31:02 +01:00
@mixin RV-Spacing__Inner--medium() {
2020-08-23 11:35:47 +02:00
padding: $-spacing-medium;
2021-01-02 20:31:02 +01:00
gap: $-spacing-medium;
column-gap: $-spacing-medium;
@include _flexrow_breakpoint_min_width($-spacing-medium);
@include _flexgrid_masonry_column_gap($-spacing-medium);
2020-08-23 11:35:47 +02:00
}
2021-01-02 20:31:02 +01:00
@mixin RV-Spacing__Inner--large() {
2020-08-23 11:35:47 +02:00
padding: $-spacing-large;
2021-01-02 20:31:02 +01:00
gap: $-spacing-large;
column-gap: $-spacing-large;
@include _flexrow_breakpoint_min_width($-spacing-large);
@include _flexgrid_masonry_column_gap($-spacing-medium);
2020-08-23 11:35:47 +02:00
}
@mixin RV-Spacing {
2021-01-02 20:31:02 +01:00
&__Outer {
2020-08-23 11:35:47 +02:00
&--small {
@include RV-Spacing__Outer--small;
}
&--medium {
@include RV-Spacing__Outer--medium;
}
&--large {
@include RV-Spacing__Outer--large;
}
}
2021-01-02 20:31:02 +01:00
&__Inner {
2020-08-23 11:35:47 +02:00
&--small {
2021-01-02 20:31:02 +01:00
@include RV-Spacing__Inner--small;
2020-08-23 11:35:47 +02:00
}
&--medium {
2021-01-02 20:31:02 +01:00
@include RV-Spacing__Inner--medium;
2020-08-23 11:35:47 +02:00
}
&--large {
2021-01-02 20:31:02 +01:00
@include RV-Spacing__Inner--large;
2020-08-23 11:35:47 +02:00
}
}
}
.RV-Spacing {
@include RV-Spacing;
}