diff options
Diffstat (limited to 'src/objects/_alert.scss')
-rw-r--r-- | src/objects/_alert.scss | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss index 067c00c..825f7ce 100644 --- a/src/objects/_alert.scss +++ b/src/objects/_alert.scss | |||
@@ -1,42 +1,25 @@ | |||
1 | @use 'iro-sass/src/index' as iro; | 1 | @use 'sass:map'; |
2 | @use '../functions' as fn; | 2 | @use 'sass:meta'; |
3 | @use 'iro-sass/src/bem'; | ||
4 | @use 'iro-sass/src/props'; | ||
5 | @use '../props' as *; | ||
3 | 6 | ||
4 | $themes: 'accent' 'positive' 'negative' 'warning' !default; | 7 | @forward 'alert.vars'; |
8 | @use 'alert.vars' as vars; | ||
5 | 9 | ||
6 | @include iro.props-namespace('alert') { | 10 | @mixin styles { |
7 | @include iro.props-store(( | 11 | @include materialize-at-root(meta.module-variables('vars')); |
8 | --dims: ( | ||
9 | --border: fn.global-dim(--border --medium), | ||
10 | --pad-i: fn.global-dim(--size --250), | ||
11 | --pad-b: fn.global-dim(--size --200), | ||
12 | --rounding: fn.global-dim(--rounding), | ||
13 | ), | ||
14 | --colors: ( | ||
15 | --bg: fn.global-color(--bg-l2), | ||
16 | --border: fn.global-color(--text-mute-more), | ||
17 | ), | ||
18 | )); | ||
19 | 12 | ||
20 | @each $theme in $themes { | 13 | @include bem.object('alert') { |
21 | @include iro.props-store(( | 14 | padding-block: props.get(vars.$pad-b); |
22 | --colors: ( | 15 | padding-inline: props.get(vars.$pad-i); |
23 | --#{$theme}: ( | 16 | background-color: props.get(vars.$bg-color); |
24 | --border: fn.global-color(--#{$theme} --700), | 17 | border: props.get(vars.$border-width) solid props.get(vars.$border-color); |
25 | ), | 18 | border-radius: props.get(vars.$rounding); |
26 | ), | ||
27 | )); | ||
28 | } | ||
29 | |||
30 | @include iro.bem-object(iro.props-namespace()) { | ||
31 | padding-block: fn.dim(--pad-b); | ||
32 | padding-inline: fn.dim(--pad-i); | ||
33 | border: fn.dim(--border) solid fn.color(--border); | ||
34 | border-radius: fn.dim(--rounding); | ||
35 | background-color: fn.color(--bg); | ||
36 | 19 | ||
37 | @each $theme in $themes { | 20 | @each $mod, $theme in vars.$themes-config { |
38 | @include iro.bem-modifier($theme) { | 21 | @include bem.modifier($mod) { |
39 | border-color: fn.color(--#{$theme} --border); | 22 | border-color: props.get(vars.$themes, $theme, --border-color); |
40 | } | 23 | } |
41 | } | 24 | } |
42 | } | 25 | } |