diff options
Diffstat (limited to 'src/objects/_alert.scss')
-rw-r--r-- | src/objects/_alert.scss | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss index 067c00c..697ac18 100644 --- a/src/objects/_alert.scss +++ b/src/objects/_alert.scss | |||
@@ -1,43 +1,40 @@ | |||
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 transparent; |
25 | ), | 18 | border-color: props.get(vars.$border-color); |
26 | ), | 19 | border-radius: props.get(vars.$rounding); |
27 | )); | 20 | box-shadow: |
28 | } | 21 | props.get(vars.$shadow-x) |
22 | props.get(vars.$shadow-y) | ||
23 | props.get(vars.$shadow-blur) | ||
24 | props.get(vars.$shadow-grow) | ||
25 | props.get(vars.$shadow-color); | ||
29 | 26 | ||
30 | @include iro.bem-object(iro.props-namespace()) { | 27 | @each $mod, $theme in vars.$themes-config { |
31 | padding-block: fn.dim(--pad-b); | 28 | @include bem.modifier($mod) { |
32 | padding-inline: fn.dim(--pad-i); | 29 | background-color: props.get(vars.$themes, $theme, --bg-color); |
33 | border: fn.dim(--border) solid fn.color(--border); | 30 | border-color: props.get(vars.$themes, $theme, --border-color); |
34 | border-radius: fn.dim(--rounding); | 31 | box-shadow: |
35 | background-color: fn.color(--bg); | 32 | props.get(vars.$shadow-x) |
36 | 33 | props.get(vars.$shadow-y) | |
37 | @each $theme in $themes { | 34 | props.get(vars.$shadow-blur) |
38 | @include iro.bem-modifier($theme) { | 35 | props.get(vars.$shadow-grow) |
39 | border-color: fn.color(--#{$theme} --border); | 36 | props.get(vars.$themes, $theme, --shadow-color); |
40 | } | 37 | } |
41 | } | 38 | } |
42 | } | 39 | } |
43 | } | 40 | } |