summaryrefslogtreecommitdiffstats
path: root/src/objects/_side-nav.scss
blob: 3a85560331ee8c541b92f4fbf37ba6280fd0ba27 (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
@use 'sass:meta';
@use 'iro-sass/src/iro-sass' as iro;
@use '../props';
@use 'icon.vars' as icon;

@forward 'side-nav.vars';
@use 'side-nav.vars' as vars;

@mixin styles {
    @include props.materialize(meta.module-variables('vars'));

    @include iro.bem-object('side-nav') {
        display:        flex;
        flex-direction: column;
        gap:            props.get(vars.$spacing);

        @include iro.bem-elem('header') {
            padding-block:  props.get(vars.$item--pad-b);
            padding-inline: props.get(vars.$item--pad-i);
            font-size:      props.get(vars.$header--font-size);
            font-weight:    500;
            color:          props.get(vars.$header--label-color);
            text-transform: uppercase;
            letter-spacing: .5px;

            @include iro.bem-next-twin-elem {
                margin-block-start: calc(props.get(vars.$separator) + props.get(vars.$spacing));
            }
        }

        @include iro.bem-elem('item') {
            padding-block:   props.get(vars.$item--pad-b);
            padding-inline:  props.get(vars.$item--pad-i);
            margin:          calc(-1 * props.get(vars.$item--key-focus--border-offset));
            color:           props.get(vars.$item--disabled--label-color);
            background-clip: padding-box;
            border:          props.get(vars.$item--key-focus--border-offset) solid transparent;
            border-radius:   calc(props.get(vars.$item--rounding) + props.get(vars.$item--key-focus--border-offset));

            &:link,
            &:visited,
            &:enabled {
                color: currentColor;

                @include iro.bem-multi('&:hover, &:focus-visible', 'is' 'selected') {
                    color:            props.get(vars.$item--hover--label-color);
                    background-color: props.get(vars.$item--hover--bg-color);
                }

                &:active {
                    color:            props.get(vars.$item--active--label-color);
                    background-color: props.get(vars.$item--active--bg-color);
                }

                &:focus-visible {
                    outline:    props.get(vars.$item--key-focus--border-color) solid props.get(vars.$item--key-focus--border-width);
                    box-shadow:
                        0
                        0
                        0
                        calc(props.get(vars.$item--key-focus--border-width) + props.get(vars.$item--key-focus--outline-width))
                        props.get(vars.$item--key-focus--outline-color);
                }
            }

            @include iro.bem-next-elem('header') {
                margin-block-start: calc(props.get(vars.$separator) + props.get(vars.$spacing));
            }
        }

        @include iro.bem-elem('header') {
            &:link,
            &:visited,
            &:enabled {
                color: props.get(vars.$header--label-color);
            }
        }

        @include iro.bem-elem('separator') {
            block-size: props.get(vars.$separator);
        }

        @include iro.bem-elem('icon-slot') {
            display:         flex;
            justify-content: center;
            inline-size:     props.get(icon.$size);
        }
    }
}