summaryrefslogtreecommitdiffstats
path: root/src/objects/_badge.scss
blob: cb35d3950a4e25f460d5006ca202c2b7c18fddab (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
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('badge') {
    @include iro.props-store((
        --dims: (
            --pad-x:     fn.global-dim(--size --75),
            --pad-y:     fn.global-dim(--size --50),
            --rounding:  3px,
            --font-size: fn.global-dim(--font-size --75),
        ),
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --bg:    fn.global-color(--obj-hi),
            --label: fn.global-color(--fg-lo),
            --accent: (
                --bg:    fn.global-color(--accent --primary --bg),
                --label: fn.global-color(--accent --primary --fg),
            )
        ),
    ), 'colors');

    @include iro.bem-object(iro.props-namespace()) {
        display:          inline-block;
        padding:          fn.dim(--pad-y) fn.dim(--pad-x);
        border-radius:    fn.dim(--rounding);
        background-color: fn.color(--bg);
        color:            fn.color(--label);
        font-size:        fn.dim(--font-size);
        font-weight:      500;
        line-height:      1;
        text-align:       center;
    
        @include iro.bem-modifier('accent') {
            background-color: fn.color(--accent --bg);
            color:            fn.color(--accent --label);
        }
    }
}