From 2609ca9cf761e085c4418c42f27fd6c474b26eb2 Mon Sep 17 00:00:00 2001 From: Nikita Gorin <36075690+NikitaCG@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:46:17 +0300 Subject: [PATCH] feat: export indents mixin (#626) --- .../ConstructorBlock/ConstructorBlock.scss | 54 +----------------- styles/mixins.scss | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 53 deletions(-) diff --git a/src/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.scss b/src/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.scss index 665884387..b6c7cbc86 100644 --- a/src/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.scss +++ b/src/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.scss @@ -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(&); } diff --git a/styles/mixins.scss b/styles/mixins.scss index edfc6a3ed..dba8c9760 100644 --- a/styles/mixins.scss +++ b/styles/mixins.scss @@ -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; + } + } + } +}