-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathnav.scss
More file actions
132 lines (106 loc) · 2.91 KB
/
nav.scss
File metadata and controls
132 lines (106 loc) · 2.91 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@use '../mixins/to-rem' as *;
@use '../mixins/focus-outline' as *;
@use '../mixins/icon' as *;
@layer kol-theme-component {
@include kol-icon-theme;
:host {
background-color: var(--color-mute);
}
.kol-nav {
--kol-nav-item-padding-left: 0;
--kol-nav-item-padding-right: 16;
$root: &;
&__list {
list-style: none;
// with this two properties we build a dynamic padding where each nested list has 8 + 8 = 16px more padding at its links/buttons
--kol-nav-nested-padding-left: calc(var(--kol-nav-item-padding-left) + 8);
&-item {
--kol-nav-item-padding-left: calc(var(--kol-nav-nested-padding-left) + 8);
}
}
&__entry {
&--link {
display: flex;
}
.kol-link,
.kol-button {
color: var(--color-primary);
display: flex;
min-height: var(--a11y-min-size);
padding-right: to-rem(var(--kol-nav-item-padding-right));
padding-left: to-rem(8);
gap: to-rem(8);
align-items: center;
text-decoration: none;
&:focus-visible {
@include focus-outline;
}
#{$root}__list & {
padding-left: to-rem(var(--kol-nav-item-padding-left));
border-left: 2px solid transparent;
}
#{$root}__list-item--active > #{$root}__entry-wrapper & {
border-left-color: var(--color-primary);
}
#{$root}__list-item--active > #{$root}__entry-wrapper & {
font-weight: bold;
}
&:hover .kol-span__label {
text-decoration: underline;
}
}
}
&__toggle-button {
.kol-button {
margin-bottom: to-rem(5);
$root: &;
&:focus {
outline: none;
}
&:not([disabled]):hover {
--text-background-color: var(--color-primary-variant);
--text-border-color: var(--color-primary-variant);
--text-color: var(--color-light);
}
--text-background-color: var(--color-light);
--text-border-color: var(--color-light);
--text-color: var(--color-primary);
--text-box-shadow: none;
&__text {
color: var(--text-color);
background-color: var(--text-background-color);
border-radius: var(--border-radius);
min-width: var(--a11y-min-size);
min-height: var(--a11y-min-size);
transition-duration: 0.5s;
transition-property: background-color, color, border-color;
.kol-span__container {
justify-content: center;
}
&:hover {
color: var(--text-color);
background-color: var(--text-background-color);
box-shadow: 0 2px 8px 2px rgba(8, 35, 48, 0.24);
border-color: var(--text-border-color);
}
@at-root #{$root}--hide-label & {
width: unset;
padding: to-rem(12.8);
.kol-span__label {
display: none;
}
}
@at-root #{$root}:focus {
@include focus-outline;
}
@at-root #{$root}:disabled:hover & {
color: var(--text-color);
background-color: var(--text-background-color);
box-shadow: none;
border-color: var(--text-border-color);
}
}
}
}
}
}