1
1
/* header and nav layout */
2
2
header {
3
- border-bottom : 2px solid var (--col-neutral20 );
3
+ --header-border-bottom-size : 2px ;
4
+
5
+ display : flex;
6
+ align-items : center;
7
+ border-bottom : var (--header-border-bottom-size ) solid var (--col-neutral20 );
8
+
9
+ @media (min-width : 1280px ) {
10
+ align-items : flex-end;
11
+ }
4
12
}
5
13
6
- .nav-wrapper {
7
- --nav-wrapper-padding-block : 26px ;
14
+ .header {
15
+ flex : 1 ;
16
+ }
8
17
9
- padding-block : var (--nav-wrapper-padding-block );
18
+ .nav-wrapper {
19
+ position : relative;
10
20
background-color : var (--background-color );
11
- width : 100% ;
12
-
13
- @media (min-width : 768px ) {
14
- --nav-wrapper-padding-block : 10px ;
15
- }
16
21
}
17
22
18
23
.nav {
24
+ --nav-gap : 0 26px ;
25
+
19
26
display : grid;
20
27
grid-template :
21
- 'hamburger brand tools' var (--nav-height )
22
- 'sections sections sections' 1fr / auto 1fr auto;
28
+ 'brand tools hamburger' 1fr / auto 1fr auto;
23
29
align-items : center;
24
- gap : 0 24 px ;
30
+ gap : var ( --nav-gap ) ;
25
31
margin : auto;
26
32
max-width : var (--content-max-width );
27
- height : var (--nav-height );
28
33
padding-inline : var (--content-padding-inline );
29
34
font-family : var (--body-font-family );
30
35
31
- @media (min-width : 1280px ) {
32
- display : flex;
33
- justify-content : space-between;
34
- gap : 0 32px ;
35
- }
36
-
37
36
& [aria-expanded = 'true' ] {
38
37
grid-template :
39
- 'hamburger brand' var (--nav-height )
40
- 'sections sections' 1 fr
41
- 'tools tools' var ( --nav-height ) / auto 1fr ;
38
+ 'brand hamburger ' var (--nav-height )
39
+ 'sections sections' auto
40
+ 'tools tools' 1 fr / 1fr auto ;
42
41
overflow-y : auto;
43
42
min-height : 100dvh ;
43
+
44
+ @media (min-width : 768px ) {
45
+ grid-template :
46
+ 'brand tools hamburger' var (--nav-height ) / auto 1fr auto;
47
+ min-height : auto;
48
+ }
44
49
45
50
@media (min-width : 1280px ) {
46
- min-height : 0 ;
51
+ --nav-gap : 16px ;
52
+
53
+ grid-template :
54
+ 'brand tools' auto
55
+ 'sections sections' 1fr / 1fr auto;
47
56
overflow : visible;
48
57
}
49
58
}
50
59
51
60
p {
52
61
margin : 0 ;
53
- line-height : 1 ;
54
- }
55
-
56
- a : any-link {
57
- color : currentcolor;
58
62
}
59
63
}
60
64
@@ -157,19 +161,21 @@ header {
157
161
158
162
.nav-brand__logo {
159
163
img {
164
+ display : block;
160
165
width : 83px ;
161
166
height : auto;
162
167
}
163
168
}
164
169
165
170
.nav-brand__title {
166
- font-size : var (--txt151 -font-size );
167
- line-height : var (--txt151 -line-height );
171
+ font-size : var (--txt155 -font-size );
172
+ line-height : var (--txt155 -line-height );
168
173
}
169
174
170
175
171
176
/* sections */
172
177
.nav-sections {
178
+ box-sizing : border-box;
173
179
grid-area : sections;
174
180
flex : 1 1 auto;
175
181
display : none;
@@ -182,29 +188,94 @@ header {
182
188
}
183
189
184
190
nav [aria-expanded = 'true' ] & {
191
+ --nav-sections-margin-inline : calc (var (--content-padding-inline ) * -1 );
192
+ --nav-sections-padding : 20px var (--content-padding-inline );
193
+ --nav-sections-inset : calc (100% + var (--header-border-bottom-size )) 0 auto auto;
194
+ --nav-sections-border-top : var (--header-border-bottom-size ) solid var (--col-neutral20 );
195
+
185
196
display : block;
186
197
visibility : visible;
187
198
align-self : start;
199
+ margin-inline : var (--nav-sections-margin-inline );
200
+ padding : var (--nav-sections-padding );
201
+ border-radius : 0 0 2px 2px ;
202
+ border-top : var (--nav-sections-border-top );
203
+ border-bottom : 1px solid var (--col-neutral20 );
204
+ background-color : var (--col-white );
205
+
206
+ @media (min-width : 768px ) {
207
+ --nav-sections-margin-inline : 0 ;
208
+ --nav-sections-border-top : 0 ;
209
+ --nav-sections-padding : 20px 40px ;
210
+
211
+ align-self : unset;
212
+ position : absolute;
213
+ inset : calc (100% + var (--header-border-bottom-size )) 0 auto auto;
214
+ min-width : 300px ;
215
+ box-shadow : var (--box-shadow );
216
+ }
188
217
189
218
@media (min-width : 1280px ) {
219
+ --nav-sections-padding : 0 ;
220
+
190
221
align-self : unset;
222
+ position : static;
223
+ box-shadow : none;
191
224
}
192
225
}
193
226
194
227
ul {
228
+ --nav-sections-list-gap : 12px ;
229
+
230
+ display : flex;
231
+ flex-direction : column;
232
+ gap : var (--nav-sections-list-gap );
195
233
list-style : none;
234
+ margin : 0 ;
196
235
padding-left : 0 ;
197
236
font-size : var (--txt154-font-size );
198
237
line-height : var (--txt154-line-height );
199
238
200
239
@media (min-width : 1280px ) {
201
- display : flex;
202
- gap : 24px ;
240
+ --nav-sections-list-gap : 40px ;
241
+
242
+ flex-direction : row;
203
243
margin : 0 ;
204
244
}
205
245
246
+ a : any-link {
247
+ color : currentcolor;
248
+ }
249
+
206
250
> li {
207
- font-weight : 500 ;
251
+ font-size : var (--txt159-font-size );
252
+ line-height : var (--txt159-line-height );
253
+
254
+ a : any-link {
255
+ --nav-section-link-active-color : transparent;
256
+
257
+ position : relative;
258
+ display : inline-flex;
259
+ flex-direction : column;
260
+ gap : 4px ;
261
+ text-decoration : none;
262
+
263
+ & ::after {
264
+ content : '' ;
265
+ display : block;
266
+ height : 2px ;
267
+ margin-block-end : -2px ;
268
+ background-color : var (--nav-section-link-active-color );
269
+ }
270
+
271
+ & .active ,
272
+ & : hover ,
273
+ & : focus-visible {
274
+ & ::after {
275
+ --nav-section-link-active-color : var (--col-brand30 );
276
+ }
277
+ }
278
+ }
208
279
209
280
> ul {
210
281
margin-top : 0 ;
@@ -300,5 +371,77 @@ header {
300
371
301
372
/* tools */
302
373
.nav-tools {
374
+ --nav-tools-gap : 12px ;
375
+ --nav-tools-padding-block : 20px ;
376
+
377
+ display : none;
303
378
grid-area : tools;
379
+ padding-block : var (--nav-tools-padding-block );
380
+
381
+ @media (min-width : 768px ) {
382
+ --nav-tools-padding-block : 0 ;
383
+
384
+ display : block;
385
+ }
386
+
387
+ .default-content-wrapper {
388
+ display : flex;
389
+ flex-direction : column;
390
+ gap : var (--nav-tools-gap );
391
+
392
+ @media (min-width : 768px ) {
393
+ --nav-tools-gap : 20px ;
394
+
395
+ flex-direction : row;
396
+ justify-content : flex-end;
397
+ gap : 20px ;
398
+ }
399
+ }
400
+
401
+ a .button : any-link ,
402
+ button {
403
+ margin : 0 ;
404
+
405
+ @media (max-width : 768px ) {
406
+ --button-height : auto;
407
+
408
+ min-height : auto;
409
+ padding : 0 ;
410
+ border : 0 ;
411
+ background : none;
412
+ font-size : var (--txt159-font-size );
413
+ line-height : var (--txt159-line-height );
414
+ font-weight : 400 ;
415
+ color : var (--text-color );
416
+ }
417
+
418
+ @media (min-width : 768px ) {
419
+ --button-horizontal-padding : 12px ;
420
+
421
+ font-size : var (--txt171-font-size );
422
+ line-height : var (--txt171-line-height );
423
+
424
+ & : not (.button--tertiary ) {
425
+ --button-height : 32px ;
426
+ }
427
+ }
428
+
429
+ & .button--secondary {
430
+ & : hover ,
431
+ & : focus {
432
+ @media (min-width : 768px ) {
433
+ --button-horizontal-padding : 11px ;
434
+ }
435
+ }
436
+ }
437
+ }
438
+
439
+ nav [aria-expanded = 'true' ] & {
440
+ display : block;
441
+ align-self : flex-start;
442
+
443
+ @media (min-width : 768px ) {
444
+ align-self : auto;
445
+ }
446
+ }
304
447
}
0 commit comments