diff options
Diffstat (limited to 'src/objects/_alert.scss')
-rw-r--r-- | src/objects/_alert.scss | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss index 774b443..651ad23 100644 --- a/src/objects/_alert.scss +++ b/src/objects/_alert.scss | |||
@@ -1,42 +1,24 @@ | |||
1 | @use 'sass:map'; | ||
2 | @use 'sass:meta'; | ||
1 | @use 'iro-sass/src/iro-sass' as iro; | 3 | @use 'iro-sass/src/iro-sass' as iro; |
2 | @use '../functions' as fn; | 4 | @use '../props'; |
3 | 5 | ||
4 | $themes: 'accent' 'positive' 'negative' 'warning' !default; | 6 | @forward 'alert.vars'; |
7 | @use 'alert.vars' as vars; | ||
5 | 8 | ||
6 | @include iro.props-namespace('alert') { | 9 | @mixin styles { |
7 | @include iro.props-store(( | 10 | @include props.materialize(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 | 11 | ||
20 | @each $theme in $themes { | 12 | @include iro.bem-object('alert') { |
21 | @include iro.props-store(( | 13 | padding-block: props.get(vars.$pad-b); |
22 | --colors: ( | 14 | padding-inline: props.get(vars.$pad-i); |
23 | --#{$theme}: ( | 15 | background-color: props.get(vars.$bg-color); |
24 | --border: fn.global-color(--#{$theme} --700), | 16 | border: props.get(vars.$border-width) solid props.get(vars.$border-color); |
25 | ), | 17 | 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 | background-color: fn.color(--bg); | ||
34 | border: fn.dim(--border) solid fn.color(--border); | ||
35 | border-radius: fn.dim(--rounding); | ||
36 | 18 | ||
37 | @each $theme in $themes { | 19 | @each $mod, $theme in vars.$themes { |
38 | @include iro.bem-modifier($theme) { | 20 | @include iro.bem-modifier($mod) { |
39 | border-color: fn.color(--#{$theme} --border); | 21 | border-color: props.get(vars.$populated-themes, $theme, --border-color); |
40 | } | 22 | } |
41 | } | 23 | } |
42 | } | 24 | } |