mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
12 hours ago 03accb90e5884eee38d2175e097a3b89b1d933fb
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/* Put your custom styles here and run `npm start` from the "src" directory on */
 
#TableOfContents ul li {
  margin-bottom: 1em;
}
 
.lh-copy blockquote {
  display: block;
  font-size: 0.875em;
  margin-left: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  border-left: 4px solid #ccc;
  padding-left: 1rem;
}
 
.nested-links a {
  overflow-wrap: break-word;
}
 
/* ------------------------------------------------------------------ *
 * Header navigation (see layouts/_partials/site-navigation.html)
 *
 * Colours, type, and spacing come from Tachyons classes in the template;
 * sites replace them with [params.ananke.navigation.classes]. This file only
 * holds behaviour: the collapsed panel below the Tachyons `-l` breakpoint and
 * the dropdown position above it. Without JavaScript the toggle buttons stay
 * hidden and every list stays visible.
 * ------------------------------------------------------------------ */
 
.ananke-nav-toggle,
.ananke-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375em;
  margin: 0;
  padding: 0 0.25rem;
  min-width: 24px;
  min-height: 24px;
  font: inherit;
  vertical-align: middle;
  background: transparent;
  border: 0;
  border-radius: 0.25rem;
  cursor: pointer;
}
 
.ananke-nav-toggle[hidden],
.ananke-submenu-toggle[hidden],
.ananke-submenu[hidden] {
  display: none;
}
 
.ananke-nav-toggle:focus-visible,
.ananke-submenu-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
 
.ananke-nav-slot {
  min-width: 0;
}
 
.ananke-submenu-icon,
.ananke-nav-toggle-icon {
  flex: none;
}
 
.ananke-submenu-icon,
.ananke-nav-toggle-line {
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
 
.ananke-submenu-toggle[aria-expanded="true"] .ananke-submenu-icon {
  transform: rotate(180deg);
}
 
/* The hamburger lines turn into a cross while the menu is open. */
.ananke-nav-toggle-line {
  transform-box: fill-box;
  transform-origin: center;
}
 
.ananke-nav-toggle[aria-expanded="true"] .ananke-nav-toggle-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
 
.ananke-nav-toggle[aria-expanded="true"] .ananke-nav-toggle-line:nth-child(2) {
  opacity: 0;
}
 
.ananke-nav-toggle[aria-expanded="true"] .ananke-nav-toggle-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}
 
.ananke-submenu {
  text-align: start;
}
 
.ananke-submenu-nested {
  padding-inline-start: 1rem;
}
 
.ananke-submenu a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
 
/* Small and medium screens: the lead group (brand) and the menu button in one
   row, every slot group (for example search) in its own row below, then the
   menu panel as a stacked list. */
@media not all and (min-width: 60em) {
  /* A long site title wraps instead of pushing the menu button down. */
  .ananke-nav-lead {
    flex: 1 1 0%;
    min-width: 0;
  }
 
  .ananke-nav-toggle {
    order: 1;
    min-height: 2.75rem;
    padding: 0 0.5rem;
  }
 
  .ananke-nav-slot {
    order: 2;
    flex-basis: 100%;
    margin-top: 1rem;
  }
 
  .ananke-nav-panel {
    order: 3;
    flex-basis: 100%;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
 
  .ananke-nav-collapsed .ananke-nav-panel {
    display: none;
  }
 
  .ananke-nav-menu {
    margin: 0;
    padding: 0;
  }
 
  .ananke-nav-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
  }
 
  .ananke-nav-item > .ananke-nav-link,
  .ananke-nav-item > .ananke-submenu-label {
    flex: 1 1 auto;
    padding: 0.5rem 0;
  }
 
  .ananke-nav-item > .ananke-submenu-toggle {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
 
  /* A parent without a URL: the button spans the row, and its chevron
     lines up with the chevrons of the other parents. */
  .ananke-nav-item
    > .ananke-submenu-label
    + .ananke-submenu-toggle:not([hidden]) {
    flex: 1 1 auto;
    justify-content: space-between;
    padding: 0;
    padding-inline-end: 1rem;
  }
 
  .ananke-submenu {
    flex-basis: 100%;
    margin: 0 0 0.5rem;
    padding: 0;
    padding-inline-start: 1rem;
    background-color: transparent;
    border: 0;
  }
 
  .ananke-submenu-link {
    padding-inline: 0;
  }
}
 
/* Large screens: one row, submenus as compact dropdowns. */
@media screen and (min-width: 60em) {
  .ananke-nav-toggle {
    display: none;
  }
 
  /* A slot group (for example search) shrinks before the row wraps. */
  .ananke-nav-slot {
    flex: 1 1 10rem;
    max-width: 28rem;
    margin-inline: 1.5rem;
  }
 
  /* Items in a slot group fill it, like a single search form. */
  .ananke-nav-slot > * {
    flex: 1 1 auto;
    min-width: 0;
  }
 
  .ananke-submenu-toggle {
    vertical-align: baseline;
  }
 
  .ananke-has-submenu {
    position: relative;
  }
 
  .ananke-submenu-toggle:not([hidden]) + .ananke-submenu {
    position: absolute;
    top: calc(100% + 0.5rem);
    inset-inline-start: 0;
    z-index: 10;
    min-width: 11rem;
    max-width: calc(100vw - 2rem);
  }
 
  /* Set by the script when the dropdown would leave the viewport. */
  .ananke-submenu-toggle:not([hidden]) + .ananke-submenu-flip {
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
}
 
/* Without JavaScript, align an item with a nested list to the top. */
.ananke-has-submenu:has(> .ananke-submenu-toggle[hidden]) {
  vertical-align: top;
}
 
@media (prefers-reduced-motion: reduce) {
  .ananke-submenu-icon,
  .ananke-nav-toggle-line {
    transition: none;
  }
}