summaryrefslogtreecommitdiffstats
path: root/src/objects/_alert.scss
blob: 0bb848528cdc666183a71dcbca3d9dfca956e23c (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
44
45
46
47
48
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('alert') {
    @include iro.props-store((
        --dims: (
            --border-width: 2px,
            --pad-x:        fn.global-dim(--size --250),
            --pad-y:        fn.global-dim(--size --250),
            --rounding:     4px,
        ),
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --bg:             fn.global-color(--bg-hi2),
            --border:         fn.global-color(--fg-hi2),
            --border-primary: fn.global-color(--accent --primary --bg-hi),
            --border-error:   fn.global-color(--accent --error --bg-hi),
            --border-success: fn.global-color(--accent --success --bg-hi),
            --border-warning: fn.global-color(--accent --warning --bg-hi),
        ),
    ), 'colors');

    @include iro.bem-object(iro.props-namespace()) {
        padding:          fn.dim(--pad-y) fn.dim(--pad-x);
        border:           fn.dim(--border-width) solid fn.color(--border);
        border-radius:    fn.dim(--rounding);
        background-color: fn.color(--bg);
        color:            fn.global-color(--fg);

        @include iro.bem-modifier('primary') {
            border-color: fn.color(--border-primary);
        }

        @include iro.bem-modifier('error') {
            border-color: fn.color(--border-error);
        }

        @include iro.bem-modifier('success') {
            border-color: fn.color(--border-success);
        }

        @include iro.bem-modifier('warning') {
            border-color: fn.color(--border-warning);
        }
    }
}