summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_nav.scss
blob: 03118a9fcb9cabe434940b08f4fdf8fc8c095a70 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@include namespace('nav') {
    @include store((
        --dims: (
            --font-size: 15px,
            --pad-y:     .5rem,
            --item: (
                --pad-x: 1rem,
                --pad-y: 1rem,
            ),
        ),
        --colors: (
            --bg: prop(--colors --bg-hi, $global: true),
            --logo: (
                --idle: (
                    --fg: prop(--colors --accent --color, $global: true),
                ),
                --hover: (
                    --fg: prop(--colors --fg-lo, $global: true),
                )
            ),
            --item: (
                --idle: (
                    --fg: prop(--colors --fg, $global: true),
                ),
                --hover: (
                    --fg: prop(--colors --fg-lo, $global: true),
                ),
                --active: (
                    --fg: prop(--colors --fg-lo, $global: true),
                )
            )
        )
    ));

    @include store((
        --dims: (
            --item: (
                --pad-x: .75em,
                --pad-y: .75em,
            ),
        )
    ), 'sm');

    @include component(namespace()) {
        display:          flex;
        position:         fixed;
        z-index:          10000;
        top:              0;
        left:             0;
        align-items:      center;
        padding:          prop(--dims --pad-y) 0;
        background-color: prop(--colors --bg);
        font-size:        prop(--dims --font-size);

        @include element('logo') {
            display:         inline-block;
            margin:          0;
            padding:         prop(--dims --item --pad-y) 0;
            color:           prop(--colors --logo --idle --fg);
            font-family:     $font-fam--mono;
            text-decoration: none;

            &:link,
            &:visited {
                &:hover {
                    background-color: transparent;
                    color:            prop(--colors --logo --hover --fg);
                }
            }
        }

        @include element('logo-symbol') {
            display: block;
            width:   $line-height * .9em;
            height:  $line-height * 1em;
        }

        @include element('item') {
            display:         inline-block;
            margin:          0 calc(-1 * #{prop(--dims --item --pad-x)}) 0 prop(--dims --item --pad-x);
            padding:         prop(--dims --item --pad-y) prop(--dims --item --pad-x);
            color:           prop(--colors --item --idle --fg);
            text-decoration: none;
            text-transform:  uppercase;

            &:hover {
                background-color: transparent;
                color:            prop(--colors --item --hover --fg);
                text-decoration:  underline;
            }

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

        @include media('<=md') {
            position: static;
        }
    }
}