summaryrefslogtreecommitdiffstats
path: root/src/objects/_alert.scss
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects/_alert.scss')
-rw-r--r--src/objects/_alert.scss77
1 files changed, 40 insertions, 37 deletions
diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss
index 067c00c..e6abc62 100644
--- a/src/objects/_alert.scss
+++ b/src/objects/_alert.scss
@@ -1,43 +1,46 @@
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 &::before {
31 padding-block: fn.dim(--pad-b); 28 display: block;
32 padding-inline: fn.dim(--pad-i); 29 margin-block: -100em 100em;
33 border: fn.dim(--border) solid fn.color(--border); 30 content: '';
34 border-radius: fn.dim(--rounding); 31 }
35 background-color: fn.color(--bg);
36 32
37 @each $theme in $themes { 33 @each $mod, $theme in vars.$themes-config {
38 @include iro.bem-modifier($theme) { 34 @include bem.modifier($mod) {
39 border-color: fn.color(--#{$theme} --border); 35 background-color: props.get(vars.$themes, $theme, --bg-color);
40 } 36 border-color: props.get(vars.$themes, $theme, --border-color);
41 } 37 box-shadow:
42 } 38 props.get(vars.$shadow-x)
39 props.get(vars.$shadow-y)
40 props.get(vars.$shadow-blur)
41 props.get(vars.$shadow-grow)
42 props.get(vars.$themes, $theme, --shadow-color);
43 }
44 }
45 }
43} 46}