Skip to content

Commit

Permalink
feat: export indents mixin (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG authored Oct 12, 2023
1 parent 12608ad commit 2609ca9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,5 @@
$block: '.#{$ns}constructor-block';

#{$block} {
@include add-specificity(&) {
&_indentTop {
&_0 {
margin-top: 0;
}

&_xs {
margin-top: $indentXS;
}

&_s {
margin-top: $indentSM;
}

&_m {
margin-top: $indentM;
}

&_l {
margin-top: $indentL;
}

&_xl {
margin-top: $indentXL;
}
}

&_indentBottom {
&_0 {
padding-bottom: 0;
}

&_xs {
padding-bottom: $indentXS;
}

&_s {
padding-bottom: $indentSM;
}

&_m {
padding-bottom: $indentM;
}

&_l {
padding-bottom: $indentL;
}

&_xl {
padding-bottom: $indentXL;
}
}
}
@include indents(&);
}
57 changes: 57 additions & 0 deletions styles/mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -537,3 +537,60 @@ unpredictable css rules order in build */
padding-right: $indentXS;
}
}

// indent system for blocks
@mixin indents($class) {
@include add-specificity($class) {
&_indentTop {
&_0 {
margin-top: 0;
}

&_xs {
margin-top: $indentXS;
}

&_s {
margin-top: $indentSM;
}

&_m {
margin-top: $indentM;
}

&_l {
margin-top: $indentL;
}

&_xl {
margin-top: $indentXL;
}
}

&_indentBottom {
&_0 {
padding-bottom: 0;
}

&_xs {
padding-bottom: $indentXS;
}

&_s {
padding-bottom: $indentSM;
}

&_m {
padding-bottom: $indentM;
}

&_l {
padding-bottom: $indentL;
}

&_xl {
padding-bottom: $indentXL;
}
}
}
}

0 comments on commit 2609ca9

Please sign in to comment.