govuk_publishing_components 27.9.0 → 27.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,170 +92,73 @@
92
92
  }
93
93
  }
94
94
 
95
- $search-icon-size: 20px;
95
+ $icon-size: 20px;
96
+ $chevron-indent-spacing: 7px;
97
+
98
+ @mixin chevron($colour, $update: false) {
99
+ @if ($update == true) {
100
+ border-bottom-color: $colour;
101
+ border-right-color: $colour;
102
+ } @else {
103
+ border-bottom: 3px solid $colour;
104
+ border-right: 3px solid $colour;
105
+ content: " ";
106
+ display: inline-block;
107
+ height: 8px;
108
+ margin: 0 8px 0 2px;
109
+ transform: translateY(-35%) rotate(45deg);
110
+ vertical-align: middle;
111
+ width: 8px;
112
+ }
113
+ }
96
114
 
97
- @mixin chevron($colour) {
98
- border-bottom: 3px solid govuk-colour($colour);
99
- border-right: 3px solid govuk-colour($colour);
115
+ @mixin make-selectable-area-bigger {
116
+ background: none;
117
+ bottom: 0;
100
118
  content: " ";
101
- display: inline-block;
102
- height: 8px;
103
- margin: 0 8px 0 2px;
104
- transform: translateY(-35%) rotate(45deg);
105
- vertical-align: middle;
106
- width: 8px;
119
+ left: 0;
120
+ position: absolute;
121
+ right: 0;
122
+ top: 0;
107
123
  }
108
124
 
109
- %top-level-navigation-link-base {
125
+ @mixin pseudo-underline {
110
126
  background: none;
111
- @include govuk-font($size: 24, $weight: bold, $line-height: 20px);
112
- border: 0;
113
- box-sizing: border-box;
114
- display: block;
115
- margin: 0;
116
- padding: govuk-spacing(6) govuk-spacing(3);
117
- position: relative;
118
- text-decoration: none;
119
-
120
- &,
121
- &:link,
122
- &:visited {
123
- color: $govuk-link-colour;
124
- }
127
+ bottom: 0;
128
+ content: " ";
129
+ height: govuk-spacing(1);
130
+ left: govuk-spacing(4);
131
+ position: absolute;
132
+ right: govuk-spacing(4);
133
+ top: auto;
134
+ }
125
135
 
136
+ @mixin focus-and-focus-visible {
126
137
  &:focus {
127
- background: $govuk-focus-colour;
128
- border-color: $govuk-focus-text-colour;
129
- border-top-color: $govuk-focus-colour;
130
- color: $govuk-focus-text-colour;
131
- outline: 3px solid transparent;
132
- box-shadow: none;
133
- z-index: 1;
134
- }
135
-
136
- @include govuk-media-query($from: "tablet") {
137
- padding: govuk-spacing(6);
138
- }
139
-
140
- @include govuk-media-query($from: "desktop") {
141
- @include govuk-font($size: 16, $weight: false, $line-height: 20px);
142
- color: govuk-colour("white");
143
- display: inherit;
144
- height: govuk-spacing(9);
145
- padding: govuk-spacing(4);
146
-
147
- &:after {
148
- background: govuk-colour("black");
149
- bottom: 0;
150
- content: " ";
151
- display: block;
152
- height: govuk-spacing(1);
153
- left: govuk-spacing(4);
154
- position: absolute;
155
- right: govuk-spacing(4);
156
- }
157
-
158
- &:hover {
159
- background: govuk-colour("black");
160
- color: govuk-colour("mid-grey");
161
-
162
- &:after {
163
- background-color: govuk-colour("mid-grey");
164
- }
165
- }
166
-
167
- &:focus {
168
- @include govuk-focused-text;
169
- box-shadow: none;
170
-
171
- &:after {
172
- background-color: $govuk-focus-text-colour;
173
- }
174
- }
175
-
176
- &,
177
- &:visited {
178
- color: govuk-colour("white");
179
- }
138
+ @content;
180
139
  }
181
- }
182
-
183
- %toggle-base {
184
- @extend %top-level-navigation-link-base;
185
- @include govuk-font($size: 16, $weight: false, $line-height: 20px);
186
- border-radius: 0;
187
- cursor: pointer;
188
- padding: govuk-spacing(4);
189
- right: 0;
190
- top: 0;
191
140
 
192
- @include govuk-media-query($from: "desktop") {
193
- border: none;
141
+ &:focus-visible {
142
+ @content;
194
143
  }
195
144
  }
196
145
 
197
- %top-level-navigation-toggle-base {
198
- @extend %toggle-base;
199
- border-top: 1px solid govuk-colour("black");
200
- height: govuk-spacing(9);
201
-
202
- &:focus {
203
- border-color: $govuk-focus-colour;
146
+ @mixin focus-not-focus-visible {
147
+ & {
148
+ @content;
204
149
  }
205
150
 
206
- &.gem-c-layout-super-navigation-header__open-button {
207
- border-left-color: govuk-colour("black");
208
- border-right-color: govuk-colour("black");
209
-
210
- &,
211
- &:hover {
212
- background: govuk-colour("light-grey");
213
- color: govuk-colour("light-grey");
214
- }
215
-
216
- &:focus {
217
- color: $govuk-focus-colour;
218
- background: $govuk-focus-colour;
219
- }
220
-
221
- &:before,
222
- &:after {
223
- $width: govuk-spacing(4);
224
- $height: 4px;
225
-
226
- border: none;
227
- content: " ";
228
- display: block;
229
- margin: 0;
230
- width: $width;
231
- height: $height;
232
- background: govuk-colour("black");
233
- transform-origin: center;
234
- position: absolute;
235
- top: calc(50% - #{$height / 2});
236
- left: calc(50% - #{$width / 2});
237
- }
238
-
239
- &:before {
240
- transform: rotate(45deg);
241
- }
242
-
243
- &:after {
244
- transform: rotate(-45deg);
245
- }
151
+ &:focus:not(:focus-visible) {
152
+ @content;
246
153
  }
247
154
  }
248
155
 
249
- %search-icon {
250
- height: $search-icon-size;
251
- pointer-events: none;
252
- width: $search-icon-size;
253
- }
254
-
255
156
  // Header layout - black bar and logo.
256
157
  .gem-c-layout-super-navigation-header {
257
158
  background: govuk-colour("black");
159
+ border-top: 1px solid govuk-colour("black");
258
160
  position: relative;
161
+ top: -1px;
259
162
 
260
163
  .lte-ie8 & {
261
164
  height: govuk-spacing(9);
@@ -276,8 +179,8 @@ $search-icon-size: 20px;
276
179
 
277
180
  .gem-c-layout-super-navigation-header__header-logo {
278
181
  height: govuk-spacing(6);
279
- padding-top: govuk-spacing(3);
280
182
  padding-bottom: govuk-spacing(3);
183
+ padding-top: govuk-spacing(3);
281
184
 
282
185
  @include govuk-media-query($from: "desktop") {
283
186
  display: block;
@@ -292,6 +195,10 @@ $search-icon-size: 20px;
292
195
  }
293
196
  }
294
197
 
198
+ .gem-c-layout-super-navigation-header__navigation-toggle-wrapper {
199
+ position: relative;
200
+ }
201
+
295
202
  // Top level navigation and search.
296
203
  .gem-c-layout-super-navigation-header__navigation-items,
297
204
  .gem-c-layout-super-navigation-header__search-items {
@@ -314,7 +221,11 @@ $search-icon-size: 20px;
314
221
  }
315
222
 
316
223
  .gem-c-layout-super-navigation-header__navigation-items {
317
- .js-enabled & {
224
+ @include govuk-media-query($from: "desktop") {
225
+ display: inline-block;
226
+ }
227
+
228
+ .js-module-initialised & {
318
229
  padding: 0 0 govuk-spacing(9) 0;
319
230
 
320
231
  @include govuk-media-query($from: "desktop") {
@@ -325,94 +236,276 @@ $search-icon-size: 20px;
325
236
 
326
237
  .gem-c-layout-super-navigation-header__navigation-item,
327
238
  .gem-c-layout-super-navigation-header__search-item {
328
- margin-right: 0;
329
- padding: 0;
239
+ display: block;
240
+ margin: 0 govuk-spacing(3);
241
+ position: relative;
242
+
243
+ @include govuk-media-query($from: "tablet") {
244
+ margin: 0 govuk-spacing(6);
245
+ }
330
246
 
331
247
  @include govuk-media-query($from: "desktop") {
332
- border-bottom: none;
248
+ background: govuk-colour("black");
249
+ display: block;
333
250
  float: left;
251
+ margin: 0;
334
252
  padding: 0;
253
+ position: static;
335
254
  }
336
255
  }
337
256
 
338
257
  .gem-c-layout-super-navigation-header__navigation-item {
339
- &:after {
340
- background-color: $govuk-border-colour;
341
- content: " ";
342
- display: block;
343
- height: 1px;
344
- left: 0;
345
- right: 0;
346
- position: absolute;
258
+ border-bottom: 1px solid $govuk-border-colour;
259
+
260
+ @include govuk-media-query($from: "desktop") {
261
+ border-bottom: 0;
347
262
  }
263
+ }
264
+
265
+ // Top level navigation links and search link.
266
+ .gem-c-layout-super-navigation-header__navigation-item-link,
267
+ .gem-c-layout-super-navigation-header__search-item-link,
268
+ .gem-c-layout-super-navigation-header__navigation-second-toggle-button {
269
+ @include govuk-link-common;
270
+ @include govuk-link-style-no-visited-state;
271
+ @include govuk-link-style-no-underline;
272
+
273
+ display: inline-block;
274
+ font-size: 19px;
275
+ font-size: govuk-px-to-rem(19px);
276
+ font-weight: bold;
277
+ margin: govuk-spacing(3) 0;
348
278
 
349
279
  @include govuk-media-query($from: "desktop") {
280
+ display: block;
281
+ margin: 0;
282
+ }
283
+
284
+ &:hover {
285
+ @include govuk-link-hover-decoration;
286
+ }
287
+
288
+ &,
289
+ &:link,
290
+ &:visited {
291
+ @include focus-and-focus-visible {
292
+ @include govuk-focused-text;
293
+ }
294
+
295
+ // Undoes the :focus styles *only* for browsers that support :focus-visible.
296
+ // See https://www.tpgi.com/focus-visible-and-backwards-compatibility/
297
+ &:focus:not(:focus-visible) {
298
+ background: none;
299
+ box-shadow: none;
300
+ color: $govuk-link-colour;
301
+
302
+ &:hover {
303
+ @include govuk-link-decoration;
304
+ @include govuk-link-hover-decoration;
305
+ color: $govuk-link-hover-colour;
306
+ }
307
+ }
308
+
350
309
  &:after {
351
- content: none;
310
+ @include make-selectable-area-bigger;
311
+ }
312
+
313
+ @include govuk-media-query($from: "desktop") {
314
+ float: left;
315
+ font-size: 16px;
316
+ font-size: govuk-px-to-rem(16px);
317
+ height: govuk-spacing(4);
318
+ padding: govuk-spacing(4);
319
+ position: relative;
320
+
321
+ &:before {
322
+ @include chevron(govuk-colour("white"), true);
323
+ }
324
+
325
+ &:hover {
326
+ color: govuk-colour("mid-grey");
327
+
328
+ &:after {
329
+ background: govuk-colour("mid-grey");
330
+ }
331
+ }
332
+
333
+ // stylelint-disable max-nesting-depth
334
+ @include focus-and-focus-visible {
335
+ box-shadow: none;
336
+ color: $govuk-focus-text-colour;
337
+
338
+ &:after {
339
+ background: $govuk-focus-text-colour;
340
+ }
341
+ }
342
+
343
+ @include focus-not-focus-visible {
344
+ &,
345
+ &:hover {
346
+ color: govuk-colour("white");
347
+ text-decoration: none;
348
+ }
349
+ }
350
+ // stylelint-enable max-nesting-depth
351
+
352
+ &:focus:not(:focus-visible) {
353
+ &:after {
354
+ background: none;
355
+ }
356
+ }
357
+
358
+ &:after {
359
+ @include pseudo-underline;
360
+ }
352
361
  }
353
362
  }
363
+
364
+ &:after {
365
+ @include make-selectable-area-bigger;
366
+ }
354
367
  }
355
368
 
356
- // Top level navigation links.
357
369
  .gem-c-layout-super-navigation-header__navigation-item-link {
358
- @extend %top-level-navigation-link-base;
370
+ .js-module-initialised & {
371
+ margin-left: govuk-spacing(4);
372
+ }
373
+ }
359
374
 
360
- &,
361
- &:link, // 👈 required to override govuk-template
362
- &:visited {
363
- color: $govuk-link-colour;
375
+ .gem-c-layout-super-navigation-header__navigation-second-toggle-button {
376
+ background: none;
377
+ border: 0;
378
+ color: $govuk-link-colour;
379
+ cursor: pointer;
380
+ padding: 0;
364
381
 
365
- &:hover {
366
- color: $govuk-link-hover-colour;
382
+ @include focus-not-focus-visible {
383
+ &:before {
384
+ @include chevron($govuk-link-colour);
385
+ }
386
+ }
367
387
 
368
- @include govuk-media-query($from: "desktop") {
369
- color: govuk-colour("mid-grey");
388
+ @include focus-not-focus-visible {
389
+ &:hover {
390
+ &:before {
391
+ @include chevron($govuk-link-hover-colour, true);
370
392
  }
371
393
  }
394
+ }
372
395
 
373
- &:focus {
374
- color: $govuk-focus-text-colour;
396
+ &:focus {
397
+ &:before {
398
+ @include chevron($govuk-focus-text-colour, true);
375
399
  }
400
+ }
376
401
 
377
- @include govuk-media-query($from: "desktop") {
402
+ @include govuk-media-query($from: "desktop") {
403
+ &:after {
404
+ @include pseudo-underline;
405
+ }
406
+
407
+ @include focus-not-focus-visible {
378
408
  color: govuk-colour("white");
409
+ float: left;
410
+ font-size: 16px;
411
+ font-size: govuk-px-to-rem(16px);
412
+ height: govuk-spacing(9);
413
+ padding: govuk-spacing(4);
414
+ position: relative;
415
+ text-decoration: none;
416
+
417
+ &:before {
418
+ @include chevron(govuk-colour("white"), true);
419
+ }
420
+ }
421
+ @include focus-not-focus-visible {
422
+ &:hover {
423
+ color: govuk-colour("mid-grey");
424
+ text-decoration: none;
425
+
426
+ &:after {
427
+ background: govuk-colour("mid-grey");
428
+ }
429
+
430
+ &:before {
431
+ @include chevron(govuk-colour("mid-grey"), true);
432
+ }
433
+ }
379
434
  }
380
- }
381
435
 
382
- // This :link:focus selector is required to override the `govuk-template`
383
- // defaults.
384
- &:link:focus {
385
- color: $govuk-focus-text-colour;
436
+ @include focus-and-focus-visible {
437
+ color: $govuk-focus-text-colour;
438
+
439
+ &:after {
440
+ background: $govuk-focus-text-colour;
441
+ }
442
+
443
+ &:before {
444
+ @include chevron($govuk-focus-text-colour, true);
445
+ }
446
+ }
386
447
  }
387
448
 
388
- .js-enabled & {
389
- @include govuk-media-query($until: "desktop") {
390
- padding: govuk-spacing(6) govuk-spacing(3) govuk-spacing(6) govuk-spacing(9);
449
+ &.gem-c-layout-super-navigation-header__open-button {
450
+ @include focus-not-focus-visible {
451
+ &:before {
452
+ transform: translateY(0) rotate(225deg);
453
+ }
391
454
  }
392
455
 
393
- @include govuk-media-query($until: "tablet") {
394
- padding-left: govuk-spacing(7);
456
+ @include govuk-media-query($from: "desktop") {
457
+ @include focus-not-focus-visible {
458
+ background: govuk-colour("light-grey");
459
+ color: $govuk-link-colour;
460
+
461
+ &:before {
462
+ @include chevron($govuk-link-colour, true);
463
+ }
464
+
465
+ &:after {
466
+ background-color: $govuk-link-colour;
467
+ }
468
+ }
469
+
470
+ @include focus-and-focus-visible {
471
+ background-color: $govuk-focus-colour;
472
+ color: $govuk-focus-text-colour;
473
+
474
+ &:before {
475
+ @include chevron($govuk-focus-text-colour, true);
476
+ }
477
+
478
+ &:after {
479
+ background: $govuk-focus-text-colour;
480
+ }
481
+ }
395
482
  }
396
483
  }
397
484
  }
398
485
 
399
486
  // Search link and dropdown.
400
487
  .gem-c-layout-super-navigation-header__search-item-link {
401
- @extend %top-level-navigation-link-base;
488
+ &:link,
489
+ &:visited {
490
+ @include govuk-media-query($from: "desktop") {
491
+ background: $govuk-brand-colour;
402
492
 
403
- @include govuk-media-query($from: "desktop") {
404
- background: $govuk-link-colour;
405
- margin-left: 0;
493
+ &:hover {
494
+ background: none;
406
495
 
407
- &:focus:hover:after,
408
- &:after {
409
- content: none;
410
- }
496
+ &:before {
497
+ left: 0;
498
+ right: 0;
499
+ }
500
+ }
411
501
 
412
- &:hover:after {
413
- content: " ";
414
- left: 0;
415
- right: 0;
502
+ &:focus {
503
+ background: $govuk-focus-colour;
504
+
505
+ &:before {
506
+ content: none;
507
+ }
508
+ }
416
509
  }
417
510
  }
418
511
  }
@@ -423,18 +516,17 @@ $search-icon-size: 20px;
423
516
  }
424
517
  }
425
518
 
426
- .gem-c-layout-super-navigation-header__search-item-link-icon {
427
- @extend %search-icon;
428
- display: none;
429
-
430
- @include govuk-media-query($from: "desktop") {
431
- display: block;
432
- }
519
+ .gem-c-layout-super-navigation-header__search-item-link-icon,
520
+ .gem-c-layout-super-navigation-header__search-toggle-button-link-icon {
521
+ height: $icon-size;
522
+ pointer-events: none;
523
+ width: $icon-size;
433
524
  }
434
525
 
435
- .gem-c-layout-super-navigation-header__search-toggle-button-link-icon {
436
- @extend %search-icon;
437
- display: block;
526
+ .gem-c-layout-super-navigation-header__search-item-link-icon {
527
+ @include govuk-media-query($until: "desktop") {
528
+ @include govuk-visually-hidden;
529
+ }
438
530
  }
439
531
 
440
532
  // Search and popular content dropdown.
@@ -443,230 +535,196 @@ $search-icon-size: 20px;
443
535
  padding-bottom: govuk-spacing(4);
444
536
  padding-top: govuk-spacing(4);
445
537
 
446
- .js-enabled & {
538
+ .js-module-initialised & {
447
539
  display: block;
448
540
  }
449
541
  }
450
542
 
451
543
  // Styles for top level navigation toggle button.
452
544
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button {
453
- @extend %top-level-navigation-toggle-base;
454
- border-left: 1px solid govuk-colour("mid-grey");
545
+ @include govuk-font($size: 19, $weight: "bold", $line-height: 20px);
546
+ background: govuk-colour("black");
547
+ border: 0;
548
+ border-left: 1px solid govuk-colour("white");
549
+ border-right: 1px solid govuk-colour("white");
550
+ box-sizing: border-box;
455
551
  color: govuk-colour("white");
552
+ cursor: pointer;
553
+ height: govuk-spacing(9);
554
+ margin-right: -1px;
555
+ padding: govuk-spacing(4);
456
556
  position: absolute;
457
- right: 45px;
458
-
459
- &.gem-c-layout-super-navigation-header__open-button {
460
- border-top-color: govuk-colour("black");
461
- }
557
+ right: (govuk-spacing(9) - govuk-spacing(3));
558
+ top: 0;
462
559
 
463
560
  @include govuk-media-query($from: 360px) {
464
- &:before {
465
- @include chevron("white");
466
- }
467
- }
561
+ right: govuk-spacing(9);
468
562
 
469
- &:focus {
470
563
  &:before {
471
- border-color: $govuk-focus-text-colour;
564
+ @include chevron(govuk-colour("white"));
472
565
  }
473
566
  }
474
567
 
475
- @include govuk-media-query(360px) {
476
- right: 60px;
477
- }
568
+ @include focus-and-focus-visible {
569
+ @include govuk-focused-text;
570
+ border-color: $govuk-focus-colour;
571
+ box-shadow: none;
572
+ z-index: 10;
478
573
 
479
- @include govuk-media-query($from: "desktop") {
480
- display: none;
574
+ @include govuk-media-query($from: 360px) {
575
+ &:before {
576
+ @include chevron(govuk-colour("black"), true);
577
+ }
578
+ }
481
579
  }
482
- }
483
580
 
484
- // styles for search toggle button
485
- .gem-c-layout-super-navigation-header__search-toggle-button {
486
- @extend %top-level-navigation-toggle-base;
487
- border-top: 1px solid transparent;
488
- border-left: 1px solid govuk-colour("mid-grey");
489
- color: govuk-colour("white");
490
- position: absolute;
491
- right: (0 - govuk-spacing(3));
492
-
493
- &:after {
494
- background-color: $govuk-link-colour;
495
- content: " ";
496
- left: 0;
497
- right: 0;
498
- }
581
+ // Undoes the :focus styles *only* for browsers that support :focus-visible.
582
+ // See https://www.tpgi.com/focus-visible-and-backwards-compatibility/
583
+ @include focus-not-focus-visible {
584
+ background: none;
585
+ border-color: govuk-colour("white");
586
+ box-shadow: none;
587
+ color: govuk-colour("white");
499
588
 
500
- &:not(.gem-c-layout-super-navigation-header__open-button):focus {
501
- &:hover,
502
- &:after {
503
- background-color: $govuk-focus-colour;
504
- border-top-color: $govuk-focus-colour;
589
+ @include govuk-media-query($from: 360px) {
590
+ &:before {
591
+ @include chevron(govuk-colour("white"), true);
592
+ }
505
593
  }
506
594
  }
507
595
 
508
- @include govuk-media-query($from: 360px) {
509
- right: 0;
510
- }
511
-
512
- @include govuk-media-query($from: "desktop") {
513
- background-color: $govuk-link-colour;
514
- border-left: 0;
515
- height: govuk-spacing(9);
516
- margin-left: govuk-spacing(3);
517
- padding: govuk-spacing(4);
518
- position: relative;
519
- float: right;
520
-
521
- &.gem-c-layout-super-navigation-header__open-button {
522
- border-top-color: govuk-colour("black");
596
+ // Open button modifier
597
+ &.gem-c-layout-super-navigation-header__open-button {
598
+ @include focus-and-focus-visible {
599
+ @include govuk-focused-text;
600
+ border-color: $govuk-focus-colour;
601
+ box-shadow: none;
602
+ color: $govuk-focus-colour;
523
603
 
524
- &:hover:after {
525
- content: " ";
604
+ @include govuk-media-query($from: 360px) {
605
+ &:before {
606
+ @include chevron($govuk-focus-colour, true);
607
+ }
526
608
  }
527
609
  }
528
610
 
529
- // To avoid the 'sticky hover' problem, we need to stop the hover state on
530
- // touch screen devices.
531
- //
532
- // One solution is to use `@media(hover: hover)`. This turns on the hover
533
- // state only for devices that aren't touchscreen, but means that browsers
534
- // that don't support this media query won't get a hover state at all.
535
- //
536
- // To get around this, we do the opposite - we turn off the hover state for
537
- // for touchscreen devices.
538
- @media (hover: none), (pointer: coarse) {
539
- &:not(:focus):hover {
540
- background-color: $govuk-link-colour;
541
- color: govuk-colour("white");
611
+ @include focus-not-focus-visible {
612
+ background: govuk-colour("light-grey");
613
+ color: govuk-colour("light-grey");
542
614
 
543
- &:after {
544
- background-color: $govuk-link-colour;
615
+ @include govuk-media-query($from: 360px) {
616
+ &:before {
617
+ @include chevron(govuk-colour("light-grey"));
545
618
  }
546
619
  }
547
620
  }
548
621
  }
549
622
  }
550
623
 
551
- // styles for second level navigation toggle buttons
552
- .gem-c-layout-super-navigation-header__navigation-second-toggle-button {
553
- @extend %toggle-base;
554
- @include govuk-font($size: 24, $weight: false, $line-height: 20px);
624
+ // Styles for search toggle button.
625
+ .gem-c-layout-super-navigation-header__search-toggle-button {
626
+ @include govuk-font($size: 19, $weight: "bold", $line-height: 20px);
627
+ background: govuk-colour("black");
555
628
  border: 0;
556
- margin: 0;
557
- padding: govuk-spacing(6) govuk-spacing(3);
558
- position: relative;
559
- text-align: left;
560
- text-decoration: none;
561
- width: 100%;
629
+ border-left: 1px solid govuk-colour("white");
630
+ color: govuk-colour("white");
631
+ cursor: pointer;
632
+ height: govuk-spacing(9);
633
+ padding: govuk-spacing(4);
634
+ position: absolute;
635
+ right: (0 - govuk-spacing(3));
636
+ top: 0;
637
+ width: govuk-spacing(9);
562
638
 
563
- &:before {
564
- @include chevron("black");
639
+ @include focus-and-focus-visible {
640
+ @include govuk-focused-text;
641
+ border-color: $govuk-focus-colour;
642
+ box-shadow: none;
565
643
  }
566
644
 
567
- &,
568
- &:visited {
569
- color: $govuk-link-colour;// FIXME: contrast against govuk-colour("light-grey") not high enough
570
-
571
- @include govuk-media-query($from: "desktop") {
572
- color: govuk-colour("white");
573
- }
645
+ &:focus:not(:focus-visible) {
646
+ background: none;
647
+ border-color: govuk-colour("white");
648
+ box-shadow: none;
649
+ color: govuk-colour("white");
574
650
  }
575
651
 
576
- @include govuk-media-query($from: "tablet") {
577
- padding: govuk-spacing(6);
652
+ @include govuk-media-query($from: 360px) {
653
+ right: 0;
578
654
  }
579
655
 
580
656
  @include govuk-media-query($from: "desktop") {
581
- @include govuk-font($size: 16, $weight: false, $line-height: 20px);
582
- border-top: 1px solid transparent;
583
- color: govuk-colour("white");
584
- height: govuk-spacing(9);
585
- padding: govuk-spacing(4);
586
- position: relative;
587
-
588
- &:before {
589
- border-color: govuk-colour("white");
657
+ @include focus-not-focus-visible {
658
+ background: $govuk-brand-colour;
659
+ border-bottom: govuk-spacing(1) solid $govuk-brand-colour;
660
+ border-left: none;
661
+ position: relative;
590
662
  }
591
663
 
592
664
  &:hover {
665
+ background: govuk-colour("black");
666
+ border-bottom-color: govuk-colour("mid-grey");
593
667
  color: govuk-colour("mid-grey");
594
-
595
- &:after {
596
- background-color: govuk-colour("mid-grey");
597
- }
598
-
599
- &:before {
600
- border-color: govuk-colour("mid-grey");
601
- }
602
668
  }
603
669
 
604
- &:focus {
605
- color: $govuk-focus-text-colour;
606
-
607
- &:after {
608
- background-color: $govuk-focus-text-colour;
609
- }
610
-
611
- &:before {
612
- border-color: $govuk-focus-text-colour;
613
- }
670
+ @include focus-and-focus-visible {
671
+ @include govuk-focused-text;
672
+ border-bottom-color: $govuk-focus-colour;
673
+ box-shadow: none;
614
674
  }
615
675
  }
616
676
 
677
+ // Open button modifier
617
678
  &.gem-c-layout-super-navigation-header__open-button {
618
- border-top-color: govuk-colour("black");
619
-
620
- &:before {
621
- transform: translateY(20%) rotate(225deg);
622
- }
623
-
624
- @include govuk-media-query($from: "desktop") {
625
- background-color: govuk-colour("light-grey");
626
- color: $govuk-link-colour;
627
-
628
- &:after {
629
- background: $govuk-link-colour;
630
- }
631
-
632
- &:before {
633
- border-color: $govuk-link-colour;
634
- }
635
-
636
- &:focus {
637
- background-color: $govuk-focus-colour;
638
- color: $govuk-focus-text-colour;
639
-
640
- &:after {
641
- background-color: $govuk-focus-text-colour;
642
- }
679
+ @include focus-and-focus-visible {
680
+ @include govuk-focused-text;
681
+ border-color: $govuk-focus-colour;
682
+ box-shadow: none;
683
+ color: $govuk-focus-colour;
643
684
 
685
+ @include govuk-media-query($from: 360px) {
644
686
  &:before {
645
- border-color: $govuk-focus-text-colour;
687
+ @include chevron($govuk-focus-colour, true);
646
688
  }
647
689
  }
690
+ }
648
691
 
649
- &:active {
650
- background-color: govuk-colour("light-grey");
651
- color: $govuk-link-colour;
652
-
653
- &:before {
654
- border-color: $govuk-link-colour;
655
- }
656
- }
692
+ @include focus-not-focus-visible {
693
+ background: govuk-colour("light-grey");
694
+ border-bottom-color: govuk-colour("light-grey");
695
+ color: govuk-colour("light-grey");
657
696
  }
658
697
  }
659
698
  }
660
699
 
700
+ .gem-c-layout-super-navigation-header__navigation-top-toggle-close-icon {
701
+ color: $govuk-text-colour;
702
+ display: none;
703
+ font-size: 36px;
704
+ font-weight: normal;
705
+ left: 0;
706
+ line-height: 22px;
707
+ padding: govuk-spacing(4) 0;
708
+ pointer-events: none;
709
+ position: absolute;
710
+ right: 0;
711
+ text-align: center;
712
+ top: 0;
713
+
714
+ .gem-c-layout-super-navigation-header__open-button & {
715
+ display: block;
716
+ }
717
+ }
718
+
661
719
  // Dropdown menu.
662
720
  .gem-c-layout-super-navigation-header__navigation-dropdown-menu {
663
- background: govuk-colour("white");
721
+ background: govuk-colour("light-grey");
664
722
 
665
723
  @include govuk-media-query($from: "desktop") {
666
- background: govuk-colour("light-grey");
667
724
  left: 0;
668
725
  position: absolute;
669
726
  right: 0;
727
+ top: govuk-spacing(9);
670
728
  }
671
729
  }
672
730
 
@@ -682,7 +740,12 @@ $search-icon-size: 20px;
682
740
 
683
741
  // Dropdown menu items.
684
742
  .gem-c-layout-super-navigation-header__dropdown-list-item {
743
+ margin: 0 0 0 $chevron-indent-spacing;
744
+ padding: govuk-spacing(2) 0;
745
+ position: relative;
746
+
685
747
  @include govuk-media-query($from: "desktop") {
748
+ margin: 0;
686
749
  padding: govuk-spacing(2) 0;
687
750
  }
688
751
  }
@@ -720,11 +783,11 @@ $search-icon-size: 20px;
720
783
  }
721
784
 
722
785
  .gem-c-layout-super-navigation-header__navigation-second-item-link {
723
- display: inline-block;
724
- padding: govuk-spacing(2) 0;
786
+ &:after {
787
+ @include make-selectable-area-bigger;
788
+ }
725
789
 
726
790
  @include govuk-media-query($from: "desktop") {
727
- display: inline;
728
791
  font-weight: bold;
729
792
  padding: 0;
730
793
  }
@@ -732,8 +795,8 @@ $search-icon-size: 20px;
732
795
 
733
796
  .gem-c-layout-super-navigation-header__navigation-second-item-link--with-description {
734
797
  @include govuk-font($size: 19, $weight: bold);
735
- margin-top: govuk-spacing(2);
736
798
  margin-bottom: 0;
799
+ margin-top: govuk-spacing(2);
737
800
  }
738
801
 
739
802
  // Dropdown menu footer links.
@@ -754,11 +817,14 @@ $search-icon-size: 20px;
754
817
  }
755
818
 
756
819
  .gem-c-layout-super-navigation-header__navigation-second-footer-item {
820
+ padding: govuk-spacing(2) 0 govuk-spacing(2) $chevron-indent-spacing;
821
+ position: relative;
822
+
757
823
  @include govuk-media-query($from: "desktop") {
758
824
  box-sizing: border-box;
759
825
  float: left;
760
- width: 50%;
761
826
  padding: 0 govuk-spacing(3);
827
+ width: 50%;
762
828
  }
763
829
  }
764
830
 
@@ -766,7 +832,10 @@ $search-icon-size: 20px;
766
832
  @include govuk-font($size: 19, $weight: bold);
767
833
  display: inline-block;
768
834
  margin: govuk-spacing(1) 0;
769
- padding: govuk-spacing(2) 0;
835
+
836
+ &:after {
837
+ @include make-selectable-area-bigger;
838
+ }
770
839
 
771
840
  @include govuk-media-query($from: "desktop") {
772
841
  display: inline;
@@ -787,11 +856,10 @@ $search-icon-size: 20px;
787
856
  @include govuk-media-query($from: "desktop") {
788
857
  margin: 0;
789
858
 
790
- .js-enabled & {
859
+ .js-module-initialised & {
791
860
  left: 0;
792
861
  position: absolute;
793
862
  right: 0;
794
- top: 60px;
795
863
  }
796
864
  }
797
865
  }