govuk_publishing_components 27.9.1 → 27.10.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,73 +92,170 @@
92
92
  }
93
93
  }
94
94
 
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
- }
95
+ $search-icon-size: 20px;
114
96
 
115
- @mixin make-selectable-area-bigger {
116
- background: none;
117
- bottom: 0;
97
+ @mixin chevron($colour) {
98
+ border-bottom: 3px solid govuk-colour($colour);
99
+ border-right: 3px solid govuk-colour($colour);
118
100
  content: " ";
119
- left: 0;
120
- position: absolute;
121
- right: 0;
122
- top: 0;
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;
123
107
  }
124
108
 
125
- @mixin pseudo-underline {
109
+ %top-level-navigation-link-base {
126
110
  background: none;
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
- }
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
+ }
135
125
 
136
- @mixin focus-and-focus-visible {
137
126
  &:focus {
138
- @content;
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
+ }
139
180
  }
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;
140
191
 
141
- &:focus-visible {
142
- @content;
192
+ @include govuk-media-query($from: "desktop") {
193
+ border: none;
143
194
  }
144
195
  }
145
196
 
146
- @mixin focus-not-focus-visible {
147
- & {
148
- @content;
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;
149
204
  }
150
205
 
151
- &:focus:not(:focus-visible) {
152
- @content;
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
+ }
153
246
  }
154
247
  }
155
248
 
249
+ %search-icon {
250
+ height: $search-icon-size;
251
+ pointer-events: none;
252
+ width: $search-icon-size;
253
+ }
254
+
156
255
  // Header layout - black bar and logo.
157
256
  .gem-c-layout-super-navigation-header {
158
257
  background: govuk-colour("black");
159
- border-top: 1px solid govuk-colour("black");
160
258
  position: relative;
161
- top: -1px;
162
259
 
163
260
  .lte-ie8 & {
164
261
  height: govuk-spacing(9);
@@ -179,8 +276,8 @@ $chevron-indent-spacing: 7px;
179
276
 
180
277
  .gem-c-layout-super-navigation-header__header-logo {
181
278
  height: govuk-spacing(6);
182
- padding-bottom: govuk-spacing(3);
183
279
  padding-top: govuk-spacing(3);
280
+ padding-bottom: govuk-spacing(3);
184
281
 
185
282
  @include govuk-media-query($from: "desktop") {
186
283
  display: block;
@@ -195,10 +292,6 @@ $chevron-indent-spacing: 7px;
195
292
  }
196
293
  }
197
294
 
198
- .gem-c-layout-super-navigation-header__navigation-toggle-wrapper {
199
- position: relative;
200
- }
201
-
202
295
  // Top level navigation and search.
203
296
  .gem-c-layout-super-navigation-header__navigation-items,
204
297
  .gem-c-layout-super-navigation-header__search-items {
@@ -221,10 +314,6 @@ $chevron-indent-spacing: 7px;
221
314
  }
222
315
 
223
316
  .gem-c-layout-super-navigation-header__navigation-items {
224
- @include govuk-media-query($from: "desktop") {
225
- display: inline-block;
226
- }
227
-
228
317
  .js-module-initialised & {
229
318
  padding: 0 0 govuk-spacing(9) 0;
230
319
 
@@ -236,276 +325,94 @@ $chevron-indent-spacing: 7px;
236
325
 
237
326
  .gem-c-layout-super-navigation-header__navigation-item,
238
327
  .gem-c-layout-super-navigation-header__search-item {
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
- }
328
+ margin-right: 0;
329
+ padding: 0;
246
330
 
247
331
  @include govuk-media-query($from: "desktop") {
248
- background: govuk-colour("black");
249
- display: block;
332
+ border-bottom: none;
250
333
  float: left;
251
- margin: 0;
252
334
  padding: 0;
253
- position: static;
254
335
  }
255
336
  }
256
337
 
257
338
  .gem-c-layout-super-navigation-header__navigation-item {
258
- border-bottom: 1px solid $govuk-border-colour;
259
-
260
- @include govuk-media-query($from: "desktop") {
261
- border-bottom: 0;
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;
278
-
279
- @include govuk-media-query($from: "desktop") {
339
+ &:after {
340
+ background-color: $govuk-border-colour;
341
+ content: " ";
280
342
  display: block;
281
- margin: 0;
282
- }
283
-
284
- &:hover {
285
- @include govuk-link-hover-decoration;
343
+ height: 1px;
344
+ left: 0;
345
+ right: 0;
346
+ position: absolute;
286
347
  }
287
348
 
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
-
349
+ @include govuk-media-query($from: "desktop") {
309
350
  &:after {
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
- }
351
+ content: none;
361
352
  }
362
353
  }
363
-
364
- &:after {
365
- @include make-selectable-area-bigger;
366
- }
367
354
  }
368
355
 
356
+ // Top level navigation links.
369
357
  .gem-c-layout-super-navigation-header__navigation-item-link {
370
- .js-module-initialised & {
371
- margin-left: govuk-spacing(4);
372
- }
373
- }
374
-
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;
358
+ @extend %top-level-navigation-link-base;
381
359
 
382
- @include focus-not-focus-visible {
383
- &:before {
384
- @include chevron($govuk-link-colour);
385
- }
386
- }
360
+ &,
361
+ &:link, // 👈 required to override govuk-template
362
+ &:visited {
363
+ color: $govuk-link-colour;
387
364
 
388
- @include focus-not-focus-visible {
389
365
  &:hover {
390
- &:before {
391
- @include chevron($govuk-link-hover-colour, true);
392
- }
393
- }
394
- }
395
-
396
- &:focus {
397
- &:before {
398
- @include chevron($govuk-focus-text-colour, true);
399
- }
400
- }
401
-
402
- @include govuk-media-query($from: "desktop") {
403
- &:after {
404
- @include pseudo-underline;
405
- }
406
-
407
- @include focus-not-focus-visible {
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;
366
+ color: $govuk-link-hover-colour;
416
367
 
417
- &:before {
418
- @include chevron(govuk-colour("white"), true);
419
- }
420
- }
421
- @include focus-not-focus-visible {
422
- &:hover {
368
+ @include govuk-media-query($from: "desktop") {
423
369
  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
370
  }
434
371
  }
435
372
 
436
- @include focus-and-focus-visible {
373
+ &:focus {
437
374
  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
- }
447
- }
448
-
449
- &.gem-c-layout-super-navigation-header__open-button {
450
- @include focus-not-focus-visible {
451
- &:before {
452
- transform: translateY(0) rotate(225deg);
453
- }
454
375
  }
455
376
 
456
377
  @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
- }
378
+ color: govuk-colour("white");
379
+ }
380
+ }
469
381
 
470
- @include focus-and-focus-visible {
471
- background-color: $govuk-focus-colour;
472
- color: $govuk-focus-text-colour;
382
+ // This :link:focus selector is required to override the `govuk-template`
383
+ // defaults.
384
+ &:link:focus {
385
+ color: $govuk-focus-text-colour;
386
+ }
473
387
 
474
- &:before {
475
- @include chevron($govuk-focus-text-colour, true);
476
- }
388
+ .js-module-initialised & {
389
+ @include govuk-media-query($until: "desktop") {
390
+ padding: govuk-spacing(6) govuk-spacing(3) govuk-spacing(6) govuk-spacing(9);
391
+ }
477
392
 
478
- &:after {
479
- background: $govuk-focus-text-colour;
480
- }
481
- }
393
+ @include govuk-media-query($until: "tablet") {
394
+ padding-left: govuk-spacing(7);
482
395
  }
483
396
  }
484
397
  }
485
398
 
486
399
  // Search link and dropdown.
487
400
  .gem-c-layout-super-navigation-header__search-item-link {
488
- &:link,
489
- &:visited {
490
- @include govuk-media-query($from: "desktop") {
491
- background: $govuk-brand-colour;
492
-
493
- &:hover {
494
- background: none;
401
+ @extend %top-level-navigation-link-base;
495
402
 
496
- &:before {
497
- left: 0;
498
- right: 0;
499
- }
500
- }
403
+ @include govuk-media-query($from: "desktop") {
404
+ background: $govuk-link-colour;
405
+ margin-left: 0;
501
406
 
502
- &:focus {
503
- background: $govuk-focus-colour;
407
+ &:focus:hover:after,
408
+ &:after {
409
+ content: none;
410
+ }
504
411
 
505
- &:before {
506
- content: none;
507
- }
508
- }
412
+ &:hover:after {
413
+ content: " ";
414
+ left: 0;
415
+ right: 0;
509
416
  }
510
417
  }
511
418
  }
@@ -516,19 +423,20 @@ $chevron-indent-spacing: 7px;
516
423
  }
517
424
  }
518
425
 
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;
524
- }
525
-
526
426
  .gem-c-layout-super-navigation-header__search-item-link-icon {
527
- @include govuk-media-query($until: "desktop") {
528
- @include govuk-visually-hidden;
427
+ @extend %search-icon;
428
+ display: none;
429
+
430
+ @include govuk-media-query($from: "desktop") {
431
+ display: block;
529
432
  }
530
433
  }
531
434
 
435
+ .gem-c-layout-super-navigation-header__search-toggle-button-link-icon {
436
+ @extend %search-icon;
437
+ display: block;
438
+ }
439
+
532
440
  // Search and popular content dropdown.
533
441
  .gem-c-layout-super-navigation-header__search-and-popular {
534
442
  display: none;
@@ -542,189 +450,223 @@ $chevron-indent-spacing: 7px;
542
450
 
543
451
  // Styles for top level navigation toggle button.
544
452
  .gem-c-layout-super-navigation-header__navigation-top-toggle-button {
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;
453
+ @extend %top-level-navigation-toggle-base;
454
+ border-left: 1px solid govuk-colour("mid-grey");
551
455
  color: govuk-colour("white");
552
- cursor: pointer;
553
- height: govuk-spacing(9);
554
- margin-right: -1px;
555
- padding: govuk-spacing(4);
556
456
  position: absolute;
557
- right: (govuk-spacing(9) - govuk-spacing(3));
558
- top: 0;
457
+ right: 45px;
458
+
459
+ &.gem-c-layout-super-navigation-header__open-button {
460
+ border-top-color: govuk-colour("black");
461
+ }
559
462
 
560
463
  @include govuk-media-query($from: 360px) {
561
- right: govuk-spacing(9);
464
+ &:before {
465
+ @include chevron("white");
466
+ }
467
+ }
562
468
 
469
+ &:focus {
563
470
  &:before {
564
- @include chevron(govuk-colour("white"));
471
+ border-color: $govuk-focus-text-colour;
565
472
  }
566
473
  }
567
474
 
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;
475
+ @include govuk-media-query(360px) {
476
+ right: 60px;
477
+ }
573
478
 
574
- @include govuk-media-query($from: 360px) {
575
- &:before {
576
- @include chevron(govuk-colour("black"), true);
577
- }
578
- }
479
+ @include govuk-media-query($from: "desktop") {
480
+ display: none;
579
481
  }
482
+ }
580
483
 
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");
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));
588
492
 
589
- @include govuk-media-query($from: 360px) {
590
- &:before {
591
- @include chevron(govuk-colour("white"), true);
592
- }
493
+ &:after {
494
+ background-color: $govuk-link-colour;
495
+ content: " ";
496
+ left: 0;
497
+ right: 0;
498
+ }
499
+
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;
593
505
  }
594
506
  }
595
507
 
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;
508
+ @include govuk-media-query($from: 360px) {
509
+ right: 0;
510
+ }
603
511
 
604
- @include govuk-media-query($from: 360px) {
605
- &:before {
606
- @include chevron($govuk-focus-colour, true);
607
- }
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");
523
+
524
+ &:hover:after {
525
+ content: " ";
608
526
  }
609
527
  }
610
528
 
611
- @include focus-not-focus-visible {
612
- background: govuk-colour("light-grey");
613
- color: govuk-colour("light-grey");
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");
614
542
 
615
- @include govuk-media-query($from: 360px) {
616
- &:before {
617
- @include chevron(govuk-colour("light-grey"));
543
+ &:after {
544
+ background-color: $govuk-link-colour;
618
545
  }
619
546
  }
620
547
  }
621
548
  }
622
549
  }
623
550
 
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");
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);
628
555
  border: 0;
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);
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%;
638
562
 
639
- @include focus-and-focus-visible {
640
- @include govuk-focused-text;
641
- border-color: $govuk-focus-colour;
642
- box-shadow: none;
563
+ &:before {
564
+ @include chevron("black");
643
565
  }
644
566
 
645
- &:focus:not(:focus-visible) {
646
- background: none;
647
- border-color: govuk-colour("white");
648
- box-shadow: none;
649
- color: govuk-colour("white");
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
+ }
650
574
  }
651
575
 
652
- @include govuk-media-query($from: 360px) {
653
- right: 0;
576
+ @include govuk-media-query($from: "tablet") {
577
+ padding: govuk-spacing(6);
654
578
  }
655
579
 
656
580
  @include govuk-media-query($from: "desktop") {
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;
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");
662
590
  }
663
591
 
664
592
  &:hover {
665
- background: govuk-colour("black");
666
- border-bottom-color: govuk-colour("mid-grey");
667
593
  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
+ }
668
602
  }
669
603
 
670
- @include focus-and-focus-visible {
671
- @include govuk-focused-text;
672
- border-bottom-color: $govuk-focus-colour;
673
- box-shadow: none;
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
+ }
674
614
  }
675
615
  }
676
616
 
677
- // Open button modifier
678
617
  &.gem-c-layout-super-navigation-header__open-button {
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;
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
+ }
684
643
 
685
- @include govuk-media-query($from: 360px) {
686
644
  &:before {
687
- @include chevron($govuk-focus-colour, true);
645
+ border-color: $govuk-focus-text-colour;
688
646
  }
689
647
  }
690
- }
691
648
 
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");
696
- }
697
- }
698
- }
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;
649
+ &:active {
650
+ background-color: govuk-colour("light-grey");
651
+ color: $govuk-link-colour;
713
652
 
714
- .gem-c-layout-super-navigation-header__open-button & {
715
- display: block;
653
+ &:before {
654
+ border-color: $govuk-link-colour;
655
+ }
656
+ }
657
+ }
716
658
  }
717
659
  }
718
660
 
719
661
  // Dropdown menu.
720
662
  .gem-c-layout-super-navigation-header__navigation-dropdown-menu {
721
- background: govuk-colour("light-grey");
663
+ background: govuk-colour("white");
722
664
 
723
665
  @include govuk-media-query($from: "desktop") {
666
+ background: govuk-colour("light-grey");
724
667
  left: 0;
725
668
  position: absolute;
726
669
  right: 0;
727
- top: govuk-spacing(9);
728
670
  }
729
671
  }
730
672
 
@@ -740,12 +682,7 @@ $chevron-indent-spacing: 7px;
740
682
 
741
683
  // Dropdown menu items.
742
684
  .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
-
747
685
  @include govuk-media-query($from: "desktop") {
748
- margin: 0;
749
686
  padding: govuk-spacing(2) 0;
750
687
  }
751
688
  }
@@ -783,11 +720,11 @@ $chevron-indent-spacing: 7px;
783
720
  }
784
721
 
785
722
  .gem-c-layout-super-navigation-header__navigation-second-item-link {
786
- &:after {
787
- @include make-selectable-area-bigger;
788
- }
723
+ display: inline-block;
724
+ padding: govuk-spacing(2) 0;
789
725
 
790
726
  @include govuk-media-query($from: "desktop") {
727
+ display: inline;
791
728
  font-weight: bold;
792
729
  padding: 0;
793
730
  }
@@ -795,8 +732,8 @@ $chevron-indent-spacing: 7px;
795
732
 
796
733
  .gem-c-layout-super-navigation-header__navigation-second-item-link--with-description {
797
734
  @include govuk-font($size: 19, $weight: bold);
798
- margin-bottom: 0;
799
735
  margin-top: govuk-spacing(2);
736
+ margin-bottom: 0;
800
737
  }
801
738
 
802
739
  // Dropdown menu footer links.
@@ -817,14 +754,11 @@ $chevron-indent-spacing: 7px;
817
754
  }
818
755
 
819
756
  .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
-
823
757
  @include govuk-media-query($from: "desktop") {
824
758
  box-sizing: border-box;
825
759
  float: left;
826
- padding: 0 govuk-spacing(3);
827
760
  width: 50%;
761
+ padding: 0 govuk-spacing(3);
828
762
  }
829
763
  }
830
764
 
@@ -832,10 +766,7 @@ $chevron-indent-spacing: 7px;
832
766
  @include govuk-font($size: 19, $weight: bold);
833
767
  display: inline-block;
834
768
  margin: govuk-spacing(1) 0;
835
-
836
- &:after {
837
- @include make-selectable-area-bigger;
838
- }
769
+ padding: govuk-spacing(2) 0;
839
770
 
840
771
  @include govuk-media-query($from: "desktop") {
841
772
  display: inline;
@@ -860,6 +791,7 @@ $chevron-indent-spacing: 7px;
860
791
  left: 0;
861
792
  position: absolute;
862
793
  right: 0;
794
+ top: 60px;
863
795
  }
864
796
  }
865
797
  }