summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_outer-button.scss
blob: 21f78f4a46b7f4936eb22f95ff64b473c5c8af02 (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
72
73
74
75
76
77
78
79
80
81
82
83
@include namespace('outer-button') {
    @include store((
        --colors: (
            --fg:     prop(--colors --bg-hi, $global: true),
            --bg:     prop(--colors --fg-lo, $global: true),
            --border: rgba(#000, .1),
            --hover: (
                --bg: prop(--colors --accent --color, $global: true),
                --fg: prop(--colors --bg-hi, $global: true),
            ),
            --inverted: (
                --fg: prop(--colors --fg-lo, $global: true),
                --bg: prop(--colors --bg-hi, $global: true),
            )
        ),
        --dims: (
            --pad-x: 1.7rem,
        )
    ));

    @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-size:        1rem;
        font-weight:      700;
        letter-spacing:   .5px;
        text-decoration:  none;
        text-transform:   uppercase;

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

        @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%;

            @include next-element('content') {
                margin-left: -1px;
                border-left: 1px solid prop(--colors --border);
            }
        }

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

        @include element('content') {
            height:        100%;
            padding-right: prop(--dims --pad-x);
            padding-left:  prop(--dims --pad-x);
            transition:    border-color .2s;
            font-size:     1 / 16 * 14em;
            line-height:   prop(--dims --outer, $global: true);
            white-space:   nowrap;
        }
        
        &:link,
        &:visited {
            &:hover {
                background-color: prop(--colors --hover --bg);
                color:            prop(--colors --hover --fg);

                @include element('icon') {
                    @include next-element('content') {
                        border-left-color: transparent;
                    }
                }
            }
        }
    }
}