summaryrefslogtreecommitdiffstats
path: root/src/objects/_alert.scss
blob: 067c00c91a0a724587817440516a791390dc6b30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

$themes: 'accent' 'positive' 'negative' 'warning' !default;

@include iro.props-namespace('alert') {
    @include iro.props-store((
        --dims: (
            --border:   fn.global-dim(--border --medium),
            --pad-i:    fn.global-dim(--size --250),
            --pad-b:    fn.global-dim(--size --200),
            --rounding: fn.global-dim(--rounding),
        ),
        --colors: (
            --bg:     fn.global-color(--bg-l2),
            --border: fn.global-color(--text-mute-more),
        ),
    ));

    @each $theme in $themes {
        @include iro.props-store((
            --colors: (
                --#{$theme}: (
                    --border: fn.global-color(--#{$theme} --700),
                ),
            ),
        ));
    }

    @include iro.bem-object(iro.props-namespace()) {
        padding-block:    fn.dim(--pad-b);
        padding-inline:   fn.dim(--pad-i);
        border:           fn.dim(--border) solid fn.color(--border);
        border-radius:    fn.dim(--rounding);
        background-color: fn.color(--bg);

        @each $theme in $themes {
            @include iro.bem-modifier($theme) {
                border-color: fn.color(--#{$theme} --border);
            }
        }
    }
}