summaryrefslogtreecommitdiffstats
path: root/src/objects/_badge.scss
blob: b3b0c13ef76c13aa0527883d93e370175db722ee (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
@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);
        line-height:      1;
        text-align:       center;
    
        @include iro.bem-modifier('accent') {
            background-color: fn.color(--accent --bg);
            color:            fn.color(--accent --label);
        }
    }
}