diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/_utils.scss | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/src/_utils.scss b/src/_utils.scss index 3c8b1c3..99c751c 100644 --- a/src/_utils.scss +++ b/src/_utils.scss | |||
@@ -1,6 +1,14 @@ | |||
1 | @use 'iro-sass/src/index' as iro; | 1 | @use 'iro-sass/src/index' as iro; |
2 | @use 'functions' as fn; | 2 | @use 'functions' as fn; |
3 | 3 | ||
4 | $dirs: ( | ||
5 | '': '', | ||
6 | 't': '-top', | ||
7 | 'r': '-right', | ||
8 | 'b': '-bottom', | ||
9 | 'l': '-left', | ||
10 | ); | ||
11 | |||
4 | @include iro.bem-utility('d-block') { | 12 | @include iro.bem-utility('d-block') { |
5 | display: block; | 13 | display: block; |
6 | } | 14 | } |
@@ -26,16 +34,34 @@ | |||
26 | position: relative; | 34 | position: relative; |
27 | } | 35 | } |
28 | 36 | ||
29 | @include iro.bem-utility('mt-0') { | 37 | @each $dir, $suffix in $dirs { |
30 | margin-top: 0; | 38 | @include iro.bem-utility('m#{$dir}-auto') { |
31 | } | 39 | margin#{$suffix}: auto; |
40 | } | ||
41 | |||
42 | @include iro.bem-utility('m#{$dir}-0') { | ||
43 | margin#{$suffix}: 0; | ||
44 | } | ||
32 | 45 | ||
33 | @include iro.bem-utility('ml-auto') { | 46 | @each $size in ('xxs' 'xs' 'sm' 'md' 'lg' 'xl') { |
34 | margin-left: auto; | 47 | @include iro.bem-utility('m#{$dir}-#{$size}') { |
48 | margin#{$suffix}: fn.global-dim(--spacing --#{$size}); | ||
49 | } | ||
50 | } | ||
35 | } | 51 | } |
36 | 52 | ||
37 | @each $size in ('xxs' 'xs' 'sm' 'md' 'lg' 'xl') { | 53 | @each $dir, $suffix in $dirs { |
38 | @include iro.bem-utility('p-#{$size}') { | 54 | @include iro.bem-utility('p#{$dir}-auto') { |
39 | padding: fn.global-dim(--spacing --#{$size}); | 55 | padding#{$suffix}: auto; |
56 | } | ||
57 | |||
58 | @include iro.bem-utility('p#{$dir}-0') { | ||
59 | padding#{$suffix}: 0; | ||
60 | } | ||
61 | |||
62 | @each $size in ('xxs' 'xs' 'sm' 'md' 'lg' 'xl') { | ||
63 | @include iro.bem-utility('p#{$dir}-#{$size}') { | ||
64 | padding#{$suffix}: fn.global-dim(--spacing --#{$size}); | ||
65 | } | ||
40 | } | 66 | } |
41 | } | 67 | } |