summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_outer-button.scss
blob: b92dd9ee4010df8d7a323965ae9e62655c178cbd (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@include namespace('outer-button') {
    @include store((
        --colors: (
            --fg: prop(--colors --bg-hi, $global: true),
            --bg: prop(--colors --fg-lo, $global: true),
            --hover: (
                --bg: prop(--colors --accent --color, $global: true),
                --fg: prop(--colors --bg-hi, $global: true),
            ),
            --icon: (
                --fg: prop(--colors --fg-lo, $global: true),
                --bg: prop(--colors --bg-hi, $global: true),
                --hover: (
                    --fg: prop(--colors --bg-hi, $global: true),
                    --bg: prop(--colors --accent --color, $global: true),
                )
            )
        )
    ));

    @include component(namespace()) {
        display:          flex;
        height:           prop(--dims --outer, $global: true);
        transition:       background-color .2s, color .2s;
        background-color: prop(--colors --bg);
        color:            prop(--colors --fg);
        font-weight:      450;
        text-decoration:  none;

        @include element('icon') {
            display:          flex;
            position:         relative;
            flex:             0 0 auto;
            align-items:      center;
            justify-content:  center;
            width:            prop(--dims --outer, $global: true);
            height:           100%;
            transition:       background-color .2s, color .2s;
            background-color: prop(--colors --icon --bg);
            color:            prop(--colors --icon --fg);
        }

        @include modifier('icon-only') {
            @include element('icon') {
                background-color: prop(--colors --bg);
                color:            prop(--colors --fg);
            }
        }

        &:hover {
            @include multi('&', 'element' 'icon') {
                background-color: prop(--colors --hover --bg);
                color:            prop(--colors --hover --fg);
            }
        }

        @include element('icon-symbol') {
            display: block;
            width:   1.5em;
            height:  1.5em;
        }

        @include element('content') {
            height:        100%;
            padding-right: prop(--dims --outer-spacing, $global: true);
            padding-left:  prop(--dims --outer-spacing, $global: true);
            line-height:   prop(--dims --outer, $global: true);
            white-space:   nowrap;
        }
    }
}