summaryrefslogtreecommitdiffstats
path: root/src/objects/_alert.scss
blob: b90e0ecaf79b6841aaa6c8d5bd2c81e47799f536 (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
49
50
51
52
53
54
55
56
57
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('alert') {
    @include iro.props-store((
        --dims: (
            --border:   2px,
            --pad-x:    fn.global-dim(--size --250),
            --pad-y:    fn.global-dim(--size --200),
            --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 --solid --bg-hi),
            --border-error:   fn.global-color(--accent --error --solid --bg-hi),
            --border-success: fn.global-color(--accent --success --solid --bg-hi),
            --border-warning: fn.global-color(--accent --warning --solid --bg-hi),
        ),
    ), 'colors');

    @include iro.props-store((
        --dims: (
            --border:   2px,
            --pad-x:    fn.global-dim(--size --200),
            --pad-y:    fn.global-dim(--size --150),
            --rounding: 4px,
        ),
    ), 'sm');

    @include iro.bem-object(iro.props-namespace()) {
        padding:          fn.dim(--pad-y) fn.dim(--pad-x);
        border:           fn.dim(--border) 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);
        }
    }
}