summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_header.scss
blob: 1470beaa98057d6de52590526ce02d4b5eb09f93 (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
@include namespace('header') {
    @include store((
        --colors: (
            --bg: prop(--colors --bg-lo, $global: true),
            --fg: prop(--colors --fg-lo, $global: true),
            --hover: (
                --bg: prop(--colors --fg-lo, $global: true),
                --fg: prop(--colors --bg-hi, $global: true),
            ),
            --active: (
                --fg: prop(--colors --fg-lo, $global: true),
            )
        ),
        --dims: (
            --height: 4rem,
            --icon:   1.5rem,
            --pad-x:  calc(.5 * (var(--header--dims--height) - var(--header--dims--icon))),
        )
    ));

    @include store((
        --colors: (
            --bg: prop(--colors --bg-hi, $global: true),
        )
    ), 'light');

    @include store((
        --dims: (
            --height: 3.4rem,
        )
    ), 'sm');

    @include component(namespace()) {
        display: flex;
        height:  prop(--dims --height);
        filter:  drop-shadow(#{prop(--dims --obj-shadow, $global: true)} #{prop(--colors --obj-shadow, $global: true)});

        @include element('item') {
            padding:          0 prop(--dims --pad-x);
            transition:       background-color .2s, color .2s, border-left-color .2s;
            background-color: prop(--colors --bg);
            color:            prop(--colors --fg);
            line-height:      prop(--dims --height);
            text-decoration:  none;

            @include next-twin-element {
                margin-left: 2px;
            }

            &:hover,
            &:focus {
                border-left-color: prop(--colors --hover --bg);
                background-color:  prop(--colors --hover --bg);
                color:             prop(--colors --hover --fg);
            }

            @include modifier('icon') {
                display:         flex;
                align-items:     center;
                justify-content: center;
            }

            @include modifier('active') {
                color:       prop(--colors --active --fg);
                font-weight: bold;
            }
        }

        @include element('icon') {
            width:  prop(--dims --icon);
            height: prop(--dims --icon);
        }

        @include media('>=lg') {
            position:      sticky;
            top:           2px;
            margin-bottom: calc(-.75 * #{prop(--dims --height)});
        }
    }
}