summaryrefslogtreecommitdiffstats
path: root/src/objects/_badge.scss
blob: 7bde262284e71fd9e233b58ff9dd56b9ab5d0539 (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
@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),
            --fixed-100: 1em,
            --fixed-200: 1.5em,
        ),
    ), '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);
        }
    
        @include iro.bem-modifier('fixed-100') {
            width: fn.dim(--fixed-100);
        }
    
        @include iro.bem-modifier('fixed-200') {
            width: fn.dim(--fixed-200);
        }
    }
}