govuk_tech_docs 4.3.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -0
  3. data/example/config/tech-docs.yml +3 -0
  4. data/lib/govuk_tech_docs/version.rb +1 -1
  5. data/lib/source/layouts/_footer.erb +15 -0
  6. data/lib/source/layouts/_header.erb +15 -13
  7. data/lib/source/layouts/core.erb +21 -8
  8. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +8 -14
  9. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +8 -14
  10. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.svg +1 -1
  11. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  12. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +1 -0
  13. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +1 -0
  14. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  15. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  16. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  17. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +1 -0
  18. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  19. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  20. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +4 -1
  21. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +4 -1
  22. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +4 -1
  23. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +7 -1
  24. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +1 -0
  25. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +2 -12
  26. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +2 -12
  27. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +2 -12
  28. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +53 -9
  29. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +201 -11
  30. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +1 -0
  31. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +1 -0
  32. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +1 -0
  33. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +23 -4
  34. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
  35. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  36. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +11 -0
  37. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +14 -4
  38. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +1 -1
  39. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +5 -1
  40. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +39 -1
  41. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +0 -9
  42. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
  43. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +65 -0
  44. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +25 -0
  45. data/package-lock.json +7 -7
  46. data/package.json +1 -1
  47. metadata +11 -1
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m0 0v512h512v-512zm415.76 238.55c11.12-4.56 24.05.88 28.67 12.11 4.63 11.17-.72 24.05-11.85 28.61-11.34 4.68-24.21-.67-28.83-11.88-4.65-11.18.67-24.18 12.01-28.84zm-39.05-58.11c11.12-4.56 24.05.89 28.68 12.12 4.62 11.17-.73 24.04-11.85 28.6-11.34 4.68-24.21-.67-28.83-11.88-4.65-11.18.67-24.18 12-28.84zm-58.98-35.19c11.12-4.57 24.05.88 28.67 12.11 4.62 11.17-.72 24.04-11.85 28.6-11.34 4.68-24.21-.67-28.84-11.88-4.64-11.18.67-24.18 12.01-28.83zm-101.34-55.92 27.83 8.81.09-.08c.77-1.03 1.68-1.94 2.7-2.73l.08-.08-11.2-35.25h20.12s20.12 0 20.12 0l-11.2 35.25.08.08c1.02.79 1.93 1.7 2.7 2.73l.08.08 27.84-8.81v41.08l-27.87-14.63-.06.06c-.83 1.08-1.8 2.04-2.88 2.86l16 48.28c.02.06.05.12.06.18l.02.05c.74 2.42 1.14 4.98 1.14 7.63 0 13.06-9.65 23.85-22.19 25.7-.18.03-.37.06-.55.08-1.07.14-2.16.23-3.26.23-1.11 0-2.19-.09-3.26-.23-.19-.02-.38-.06-.56-.08-12.55-1.85-22.19-12.63-22.19-25.7 0-2.65.4-5.21 1.15-7.62s.01-.06.01-.06c.02-.06.04-.12.06-.18l16.01-48.28c-1.09-.81-2.06-1.77-2.88-2.86l-.06-.06-27.87 14.63v-41.08zm48.11 174.62c-11.34 4.68-24.21-.67-28.84-11.88-4.64-11.18.67-24.18 12.01-28.83 11.12-4.57 24.05.88 28.67 12.11 4.62 11.17-.72 24.04-11.85 28.6zm-99.28-106.59c4.62-11.23 17.55-16.68 28.67-12.11 11.34 4.65 16.65 17.65 12.01 28.83-4.62 11.21-17.49 16.56-28.84 11.88-11.12-4.56-16.47-17.44-11.85-28.6zm-58.99 35.2c4.63-11.22 17.55-16.68 28.68-12.12 11.34 4.65 16.65 17.65 12 28.84-4.62 11.21-17.49 16.56-28.83 11.88-11.12-4.56-16.48-17.44-11.85-28.6zm-39.04 58.11c4.62-11.23 17.55-16.68 28.67-12.11 11.34 4.65 16.66 17.65 12.01 28.84-4.62 11.21-17.49 16.56-28.83 11.88-11.13-4.55-16.47-17.43-11.85-28.61zm335.98 169.34c-44.5-6.37-94.44-9.94-147.21-9.94s-102.66 3.57-147.14 9.93c-12.63-53.1-28-83.53-43.87-105.19l29.89-10.64c-2.97 15.18-3.45 22.24-.12 32 4.93-4.82 9.6-13.68 13.25-27.23l14.49 48.23c-8.82-6.07-15.61-9.99-23.39-10.17 13.79 29.7 31.01 37.34 42.17 35.28 13.62-2.5 19.89-14.65 17.78-24.95-3.13-14.6-18.12-18.41-25.12-1.42-13.39-27.31 9.32-35.81 23.93-27.73-22.44-22.39-25.01-42.29-6.89-66.38 25.24 19.3 25.54 38.41 14.18 65.3 14.74-16.87 37.68-7.81 29.4 19.45-10.64-16.46-24.71-6.1-22.5 9.53 1.87 13.62 19.85 24.62 42.25 22.68 32.1-2.91 34.01-25.06 34.81-43.39-7.89-1.46-22.1 5.86-34.22 22.87l-4.46-51.16c13.18 13.74 25.16 16.35 38.46 16.77-4.43-13.82-24.78-36.46-24.78-36.46h63.85s-20.35 22.64-24.78 36.46c13.3-.42 25.28-3.03 38.46-16.77l-4.46 51.16c-12.11-17.01-26.32-24.33-34.21-22.87.8 18.34 2.71 40.48 34.81 43.39 22.39 1.95 40.38-9.05 42.25-22.68 2.21-15.63-11.86-25.99-22.49-9.53-8.29-27.26 14.65-36.32 29.39-19.45-11.36-26.89-11.07-46 14.18-65.3 18.12 24.08 15.55 43.99-6.9 66.38 14.62-8.08 37.32.43 23.94 27.73-7-16.99-21.98-13.18-25.12 1.42-2.11 10.3 4.15 22.46 17.77 24.95 11.16 2.06 28.38-5.58 42.17-35.28-7.77.18-14.57 4.11-23.38 10.17l14.48-48.23c3.65 13.55 8.32 22.41 13.25 27.23 3.33-9.76 2.85-16.82-.12-32l29.89 10.64c-15.88 21.66-31.25 52.09-43.88 105.2z"/></svg>
@@ -1,4 +1,4 @@
1
- const version = '5.9.0';
1
+ const version = '5.10.2';
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=govuk-frontend-version.mjs.map
@@ -576,6 +576,7 @@
576
576
  identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
577
577
  });
578
578
  }
579
+ this.$errorMessage = this.$root.querySelector('.govuk-error-message');
579
580
  if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
580
581
  $textareaDescription.textContent = this.i18n.t('textareaDescription', {
581
582
  count: this.maxLength
@@ -634,7 +635,9 @@
634
635
  const remainingNumber = this.maxLength - this.count(this.$textarea.value);
635
636
  const isError = remainingNumber < 0;
636
637
  this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
637
- this.$textarea.classList.toggle('govuk-textarea--error', isError);
638
+ if (!this.$errorMessage) {
639
+ this.$textarea.classList.toggle('govuk-textarea--error', isError);
640
+ }
638
641
  this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
639
642
  this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
640
643
  this.$visibleCountMessage.textContent = this.getCountMessage();
@@ -570,6 +570,7 @@ class CharacterCount extends ConfigurableComponent {
570
570
  identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
571
571
  });
572
572
  }
573
+ this.$errorMessage = this.$root.querySelector('.govuk-error-message');
573
574
  if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
574
575
  $textareaDescription.textContent = this.i18n.t('textareaDescription', {
575
576
  count: this.maxLength
@@ -628,7 +629,9 @@ class CharacterCount extends ConfigurableComponent {
628
629
  const remainingNumber = this.maxLength - this.count(this.$textarea.value);
629
630
  const isError = remainingNumber < 0;
630
631
  this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
631
- this.$textarea.classList.toggle('govuk-textarea--error', isError);
632
+ if (!this.$errorMessage) {
633
+ this.$textarea.classList.toggle('govuk-textarea--error', isError);
634
+ }
632
635
  this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
633
636
  this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
634
637
  this.$visibleCountMessage.textContent = this.getCountMessage();
@@ -71,6 +71,7 @@ class CharacterCount extends ConfigurableComponent {
71
71
  identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
72
72
  });
73
73
  }
74
+ this.$errorMessage = this.$root.querySelector('.govuk-error-message');
74
75
  if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
75
76
  $textareaDescription.textContent = this.i18n.t('textareaDescription', {
76
77
  count: this.maxLength
@@ -129,7 +130,9 @@ class CharacterCount extends ConfigurableComponent {
129
130
  const remainingNumber = this.maxLength - this.count(this.$textarea.value);
130
131
  const isError = remainingNumber < 0;
131
132
  this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
132
- this.$textarea.classList.toggle('govuk-textarea--error', isError);
133
+ if (!this.$errorMessage) {
134
+ this.$textarea.classList.toggle('govuk-textarea--error', isError);
135
+ }
133
136
  this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
134
137
  this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
135
138
  this.$visibleCountMessage.textContent = this.getCountMessage();
@@ -1,3 +1,5 @@
1
+ @import "../button/index";
2
+
1
3
  @include govuk-exports("govuk/component/cookie-banner") {
2
4
  // This needs to be kept in sync with the header component's styles
3
5
  $border-bottom-width: govuk-spacing(2);
@@ -11,7 +13,11 @@
11
13
  // changes colours in their browser.
12
14
  border-bottom: $border-bottom-width solid transparent;
13
15
 
14
- background-color: $govuk-canvas-background-colour;
16
+ @include _govuk-rebrand(
17
+ "background-color",
18
+ $govuk-template-background-colour,
19
+ $_govuk-rebrand-template-background-colour
20
+ );
15
21
  }
16
22
 
17
23
  // Support older browsers which don't hide elements with the `hidden` attribute
@@ -2,6 +2,7 @@
2
2
  @import "../input/index";
3
3
  @import "../hint/index";
4
4
  @import "../label/index";
5
+ @import "../fieldset/index";
5
6
 
6
7
  @include govuk-exports("govuk/component/date-input") {
7
8
  .govuk-date-input {
@@ -507,6 +507,8 @@
507
507
  this.$status = void 0;
508
508
  this.i18n = void 0;
509
509
  this.id = void 0;
510
+ this.$announcements = void 0;
511
+ this.enteredAnotherElement = void 0;
510
512
  const $input = this.$root.querySelector('input');
511
513
  if ($input === null) {
512
514
  throw new ElementError({
@@ -596,12 +598,6 @@
596
598
  this.enteredAnotherElement = false;
597
599
  });
598
600
  }
599
-
600
- /**
601
- * Updates the visibility of the dropzone as users enters the various elements on the page
602
- *
603
- * @param {DragEvent} event - The `dragenter` event
604
- */
605
601
  updateDropzoneVisibility(event) {
606
602
  if (this.$button.disabled) return;
607
603
  if (event.target instanceof Node) {
@@ -626,12 +622,6 @@
626
622
  hideDraggingState() {
627
623
  this.$button.classList.remove('govuk-file-upload-button--dragging');
628
624
  }
629
-
630
- /**
631
- * Handles user dropping on the component
632
- *
633
- * @param {DragEvent} event - The `dragenter` event
634
- */
635
625
  onDrop(event) {
636
626
  event.preventDefault();
637
627
  if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
@@ -501,6 +501,8 @@ class FileUpload extends ConfigurableComponent {
501
501
  this.$status = void 0;
502
502
  this.i18n = void 0;
503
503
  this.id = void 0;
504
+ this.$announcements = void 0;
505
+ this.enteredAnotherElement = void 0;
504
506
  const $input = this.$root.querySelector('input');
505
507
  if ($input === null) {
506
508
  throw new ElementError({
@@ -590,12 +592,6 @@ class FileUpload extends ConfigurableComponent {
590
592
  this.enteredAnotherElement = false;
591
593
  });
592
594
  }
593
-
594
- /**
595
- * Updates the visibility of the dropzone as users enters the various elements on the page
596
- *
597
- * @param {DragEvent} event - The `dragenter` event
598
- */
599
595
  updateDropzoneVisibility(event) {
600
596
  if (this.$button.disabled) return;
601
597
  if (event.target instanceof Node) {
@@ -620,12 +616,6 @@ class FileUpload extends ConfigurableComponent {
620
616
  hideDraggingState() {
621
617
  this.$button.classList.remove('govuk-file-upload-button--dragging');
622
618
  }
623
-
624
- /**
625
- * Handles user dropping on the component
626
- *
627
- * @param {DragEvent} event - The `dragenter` event
628
- */
629
619
  onDrop(event) {
630
620
  event.preventDefault();
631
621
  if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
@@ -22,6 +22,8 @@ class FileUpload extends ConfigurableComponent {
22
22
  this.$status = void 0;
23
23
  this.i18n = void 0;
24
24
  this.id = void 0;
25
+ this.$announcements = void 0;
26
+ this.enteredAnotherElement = void 0;
25
27
  const $input = this.$root.querySelector('input');
26
28
  if ($input === null) {
27
29
  throw new ElementError({
@@ -111,12 +113,6 @@ class FileUpload extends ConfigurableComponent {
111
113
  this.enteredAnotherElement = false;
112
114
  });
113
115
  }
114
-
115
- /**
116
- * Updates the visibility of the dropzone as users enters the various elements on the page
117
- *
118
- * @param {DragEvent} event - The `dragenter` event
119
- */
120
116
  updateDropzoneVisibility(event) {
121
117
  if (this.$button.disabled) return;
122
118
  if (event.target instanceof Node) {
@@ -141,12 +137,6 @@ class FileUpload extends ConfigurableComponent {
141
137
  hideDraggingState() {
142
138
  this.$button.classList.remove('govuk-file-upload-button--dragging');
143
139
  }
144
-
145
- /**
146
- * Handles user dropping on the component
147
- *
148
- * @param {DragEvent} event - The `dragenter` event
149
- */
150
140
  onDrop(event) {
151
141
  event.preventDefault();
152
142
  if (event.dataTransfer && isContainingFiles(event.dataTransfer)) {
@@ -1,7 +1,7 @@
1
1
  @include govuk-exports("govuk/component/footer") {
2
- $govuk-footer-background: $govuk-canvas-background-colour;
3
- $govuk-footer-border: $govuk-border-colour;
2
+ $govuk-footer-background: $govuk-template-background-colour;
4
3
  $govuk-footer-text: $govuk-text-colour;
4
+ $govuk-footer-content-border: $govuk-border-colour;
5
5
 
6
6
  // Royal Arms image dimensions
7
7
  $govuk-footer-crest-image-width: 125px;
@@ -12,9 +12,17 @@
12
12
  @include govuk-responsive-padding(7, "top");
13
13
  @include govuk-responsive-padding(5, "bottom");
14
14
 
15
- border-top: 1px solid $govuk-footer-border;
15
+ border-top: 10px solid $govuk-brand-colour;
16
16
  color: $govuk-footer-text;
17
- background: $govuk-footer-background;
17
+ @include _govuk-rebrand(
18
+ "background",
19
+ $from: $govuk-footer-background,
20
+ $to: $_govuk-rebrand-template-background-colour
21
+ );
22
+ }
23
+
24
+ .govuk-footer__crown {
25
+ margin-bottom: govuk-spacing(5);
18
26
  }
19
27
 
20
28
  .govuk-footer__link {
@@ -26,7 +34,12 @@
26
34
  margin: 0; // Reset `<hr>` default margins
27
35
  @include govuk-responsive-margin(8, "bottom");
28
36
  border: 0; // Reset `<hr>` default borders
29
- border-bottom: 1px solid $govuk-footer-border;
37
+ border-bottom: 1px solid;
38
+ @include _govuk-rebrand(
39
+ "border-bottom-color",
40
+ $from: $govuk-footer-content-border,
41
+ $to: $_govuk-rebrand-border-colour-on-blue-tint-95
42
+ );
30
43
  }
31
44
 
32
45
  .govuk-footer__meta {
@@ -71,9 +84,10 @@
71
84
  text-wrap: balance;
72
85
  }
73
86
 
74
- .govuk-footer__copyright-logo {
75
- display: inline-block;
76
- min-width: $govuk-footer-crest-image-width;
87
+ .govuk-footer__copyright-logo::before {
88
+ content: "";
89
+ display: block;
90
+ width: 100%;
77
91
  padding-top: ($govuk-footer-crest-image-height + govuk-spacing(2));
78
92
  background-image: govuk-image-url("govuk-crest.svg");
79
93
  background-repeat: no-repeat;
@@ -81,6 +95,30 @@
81
95
  background-size: $govuk-footer-crest-image-width $govuk-footer-crest-image-height;
82
96
  text-align: center;
83
97
  white-space: nowrap;
98
+
99
+ // Where possible use the crest as a mask instead. This lets us use
100
+ // currentColor, increasing the contrast of the image and matching the
101
+ // user's prefered foreground colour in e.g. forced colors mode.
102
+ // We test for `mask-position` rather than `mask-image` because of a false
103
+ // positive in Edge 17.
104
+ @supports ((-webkit-mask-position: initial) or (mask-position: initial)) {
105
+ background: currentcolor;
106
+ -webkit-mask-image: govuk-image-url("govuk-crest.svg");
107
+ mask-image: govuk-image-url("govuk-crest.svg");
108
+ -webkit-mask-repeat: no-repeat;
109
+ mask-repeat: no-repeat;
110
+ -webkit-mask-position: 50% 0%;
111
+ mask-position: 50% 0%;
112
+ -webkit-mask-size: $govuk-footer-crest-image-width $govuk-footer-crest-image-height;
113
+ mask-size: $govuk-footer-crest-image-width $govuk-footer-crest-image-height;
114
+
115
+ // currentcolor doesn't seem to be computed correctly in forced colors
116
+ // mode so force the background color to match the system link color
117
+ // (matching the text in the link)
118
+ @media screen and (forced-colors: active) {
119
+ background: linktext;
120
+ }
121
+ }
84
122
  }
85
123
 
86
124
  .govuk-footer__inline-list {
@@ -106,7 +144,13 @@
106
144
  @include govuk-media-query($until: tablet) {
107
145
  padding-bottom: govuk-spacing(2);
108
146
  }
109
- border-bottom: 1px solid $govuk-footer-border;
147
+
148
+ border-bottom: 1px solid;
149
+ @include _govuk-rebrand(
150
+ "border-bottom-color",
151
+ $from: $govuk-footer-content-border,
152
+ $to: $_govuk-rebrand-border-colour-on-blue-tint-95
153
+ );
110
154
  }
111
155
 
112
156
  .govuk-footer__navigation {
@@ -13,12 +13,31 @@
13
13
  $govuk-header-menu-button-height: 24px;
14
14
  $govuk-header-menu-button-width: 80px;
15
15
 
16
+ $govuk-header-rebrand-background: $govuk-brand-colour;
17
+ $govuk-header-rebrand-logo-bottom-margin: 2px;
18
+
16
19
  .govuk-header {
17
20
  @include govuk-font($size: 16, $line-height: 1);
18
21
 
19
- border-bottom: govuk-spacing(2) solid govuk-colour("white");
22
+ // Add a transparent bottom border for forced-colour modes
23
+ @include _govuk-rebrand(
24
+ "border-bottom",
25
+ $from: govuk-spacing(2) solid govuk-colour("white"),
26
+ $to: 1px solid transparent
27
+ );
28
+ @include _govuk-rebrand("background", $from: $govuk-header-background, $to: $govuk-header-rebrand-background);
29
+
20
30
  color: $govuk-header-text;
21
- background: $govuk-header-background;
31
+ }
32
+
33
+ .govuk-header--with-js-navigation {
34
+ @include govuk-media-query($until: desktop) {
35
+ .govuk-header__logo {
36
+ // Protect the absolute positioned menu button from overlapping with the
37
+ // logo with right padding using the button's width
38
+ padding-right: $govuk-header-menu-button-width;
39
+ }
40
+ }
22
41
  }
23
42
 
24
43
  .govuk-header__container--full-width {
@@ -36,8 +55,20 @@
36
55
  margin-bottom: -$govuk-header-border-width;
37
56
  padding-top: govuk-spacing($govuk-header-vertical-spacing-value);
38
57
  border-bottom: $govuk-header-border-width solid $govuk-header-border-color;
58
+
59
+ @include _govuk-rebrand {
60
+ // Remove the space allocated to the blue bar
61
+ margin-bottom: 0;
62
+
63
+ // Remove padding as the child elements are now responsible for spacing
64
+ padding-top: 0;
65
+
66
+ // Remove the blue bar
67
+ border-bottom: none;
68
+ }
39
69
  }
40
70
 
71
+ // TODO: Remove this when _govuk-rebrand becomes the default
41
72
  .govuk-header--full-width-border {
42
73
  border-bottom-color: $govuk-header-border-color;
43
74
 
@@ -69,6 +100,36 @@
69
100
  &:last-child {
70
101
  margin-right: 0;
71
102
  }
103
+
104
+ @include _govuk-rebrand {
105
+ margin-right: govuk-px-to-rem(7px); // 1 'dot'
106
+ margin-bottom: $govuk-header-rebrand-logo-bottom-margin;
107
+
108
+ // Remove right-margin if there's no product name
109
+ &:last-child {
110
+ margin-right: 0;
111
+ }
112
+ }
113
+ }
114
+
115
+ // Colour in the Dot
116
+ .govuk-logo-dot {
117
+ fill: #00ffe0;
118
+
119
+ // Override Dot colour when printing
120
+ @include govuk-media-query($media-type: print) {
121
+ fill: currentcolor;
122
+ }
123
+
124
+ // Override Dot colour on forced colours mode
125
+ @media (forced-colors: active) {
126
+ fill: currentcolor;
127
+ }
128
+
129
+ // Override Dot colour on focus
130
+ :focus & {
131
+ fill: currentcolor;
132
+ }
72
133
  }
73
134
 
74
135
  .govuk-header__product-name {
@@ -97,6 +158,40 @@
97
158
  margin-top: $product-name-offset-tablet - 0.5px;
98
159
  }
99
160
  }
161
+
162
+ @include _govuk-rebrand {
163
+ // Remove top margin
164
+ margin-top: 0;
165
+
166
+ // Remove 1px from the bottom to account for the font-size being 1px
167
+ // larger than the logo height.
168
+ margin-bottom: govuk-px-to-rem(-1px);
169
+
170
+ // Magic number font-size that visually aligns with GOV.UK logo.
171
+ // Also stops reducing the product name size on narrow screens
172
+ font-size: govuk-px-to-rem(31px);
173
+
174
+ // Reduce letter spacing
175
+ letter-spacing: -0.015em;
176
+
177
+ // Prevent forced colour modes from applying a background colour behind
178
+ // the product name, which cuts off the underline that appears on hover.
179
+ forced-color-adjust: none;
180
+
181
+ @media screen and (forced-colors: active) {
182
+ color: LinkText;
183
+ background: transparent;
184
+ }
185
+
186
+ // Remove top margin on the breakpoints too
187
+ @include govuk-media-query($from: tablet) {
188
+ margin-top: 0;
189
+ }
190
+
191
+ @include govuk-media-query($from: desktop) {
192
+ margin-top: 0;
193
+ }
194
+ }
100
195
  }
101
196
 
102
197
  .govuk-header__link {
@@ -134,12 +229,6 @@
134
229
 
135
230
  @include govuk-media-query($from: desktop) {
136
231
  display: inline;
137
-
138
- &:focus {
139
- // Replicate the focus box shadow but without the -2px y-offset of the first yellow shadow
140
- // This is to stop the logo getting cut off by the box shadow when focused on above a product name
141
- box-shadow: 0 0 $govuk-focus-colour;
142
- }
143
232
  }
144
233
 
145
234
  &:link,
@@ -159,6 +248,23 @@
159
248
  margin-bottom: 0;
160
249
  border-bottom: 0;
161
250
  }
251
+
252
+ @include _govuk-rebrand {
253
+ display: inline;
254
+
255
+ // Remove word-spacing from within the logo so we can ignore
256
+ // whitespace characters in the HTML
257
+ word-spacing: govuk-px-to-rem(-6px);
258
+
259
+ // Reset word-spacing for child elements
260
+ > * {
261
+ word-spacing: 0;
262
+ }
263
+
264
+ &:not(:focus) {
265
+ background-color: $govuk-header-rebrand-background;
266
+ }
267
+ }
162
268
  }
163
269
 
164
270
  .govuk-header__service-name {
@@ -166,6 +272,18 @@
166
272
  margin-bottom: govuk-spacing(2);
167
273
  @include govuk-font-size($size: 24);
168
274
  @include govuk-typography-weight-bold;
275
+
276
+ @include _govuk-rebrand {
277
+ // Apply margins to internal elements to emulate padding
278
+ margin-bottom: govuk-spacing(3);
279
+
280
+ @include govuk-media-query($from: desktop) {
281
+ // Magic number to align service name baseline with the GOV.UK logo
282
+ $service-name-offset: 4px;
283
+
284
+ margin: (govuk-spacing(3) + $service-name-offset) 0 (govuk-spacing(3) - $service-name-offset);
285
+ }
286
+ }
169
287
  }
170
288
 
171
289
  .govuk-header__logo,
@@ -175,9 +293,6 @@
175
293
 
176
294
  .govuk-header__logo {
177
295
  @include govuk-responsive-margin($govuk-header-vertical-spacing-value, "bottom");
178
- // Protect the absolute positioned menu button from overlapping with the
179
- // logo with right padding using the button's width
180
- padding-right: $govuk-header-menu-button-width;
181
296
 
182
297
  @include govuk-media-query($from: desktop) {
183
298
  width: 33.33%;
@@ -192,6 +307,15 @@
192
307
  float: none;
193
308
  }
194
309
  }
310
+
311
+ @include _govuk-rebrand {
312
+ // Apply margins to internal elements to emulate padding
313
+ margin-bottom: 0;
314
+
315
+ // Magic numbers, set padding to vertically centre align the logo
316
+ padding-top: 16px;
317
+ padding-bottom: 14px - $govuk-header-rebrand-logo-bottom-margin;
318
+ }
195
319
  }
196
320
 
197
321
  .govuk-header__content {
@@ -265,8 +389,37 @@
265
389
  }
266
390
 
267
391
  .govuk-header__navigation {
392
+ @include govuk-media-query($until: mobile) {
393
+ @include _govuk-rebrand {
394
+ padding-bottom: govuk-spacing(3);
395
+ }
396
+ }
397
+
268
398
  @include govuk-media-query($from: desktop) {
269
399
  margin-bottom: govuk-spacing(2);
400
+
401
+ @include _govuk-rebrand {
402
+ // Magic number so that the bottom of the nav links aligns with the
403
+ // baseline of the GOV.UK logo
404
+ $navigation-offset: 7px;
405
+
406
+ // Apply margins to internal elements to emulate padding
407
+ margin-bottom: 0;
408
+ padding: (govuk-spacing(3) + $navigation-offset) 0 (govuk-spacing(3) - $navigation-offset);
409
+ }
410
+ }
411
+ }
412
+
413
+ .govuk-header__service-name + .govuk-header__navigation {
414
+ @include _govuk-rebrand {
415
+ @include govuk-media-query($from: desktop) {
416
+ // If there's both a service name and navigation,
417
+ // remove the extra padding between them on desktop
418
+ padding-top: 0;
419
+
420
+ // Restore the full bottom padding as the navigation isn't standalone
421
+ padding-bottom: govuk-spacing(3);
422
+ }
270
423
  }
271
424
  }
272
425
 
@@ -279,6 +432,12 @@
279
432
  &[hidden] {
280
433
  display: none;
281
434
  }
435
+
436
+ @include _govuk-rebrand {
437
+ @include govuk-media-query($from: mobile, $until: desktop) {
438
+ padding-bottom: govuk-spacing(3);
439
+ }
440
+ }
282
441
  }
283
442
 
284
443
  .govuk-header__navigation--end {
@@ -305,14 +464,41 @@
305
464
  @include govuk-typography-weight-bold;
306
465
  white-space: nowrap;
307
466
  }
467
+
468
+ @include _govuk-rebrand {
469
+ // Increase top padding of nav items...
470
+ padding-top: govuk-spacing(3);
471
+
472
+ // ...except on desktop
473
+ @include govuk-media-query($from: desktop) {
474
+ padding-top: govuk-spacing(1);
475
+ }
476
+
477
+ // Change the dividing line colour between mobile nav items
478
+ border-bottom-color: govuk-colour("white");
479
+
480
+ // Reduce default weight of links so that we can use bold for active ones
481
+ a {
482
+ @include govuk-typography-weight-regular;
483
+ }
484
+ }
308
485
  }
309
486
 
310
487
  .govuk-header__navigation-item--active {
311
488
  a {
489
+ @include _govuk-rebrand {
490
+ // Change active links to use bold text instead of changing colour
491
+ @include govuk-typography-weight-bold;
492
+ }
493
+
312
494
  &:link,
313
495
  &:hover,
314
496
  &:visited {
315
497
  color: $govuk-header-link-active;
498
+
499
+ @include _govuk-rebrand {
500
+ color: inherit;
501
+ }
316
502
  }
317
503
 
318
504
  // When printing, use the normal blue as this contrasts better with the
@@ -325,6 +511,10 @@
325
511
  // contrast is still acceptable
326
512
  &:focus {
327
513
  color: $govuk-focus-text-colour;
514
+
515
+ @include _govuk-rebrand {
516
+ color: $govuk-focus-text-colour;
517
+ }
328
518
  }
329
519
  }
330
520
  }
@@ -166,6 +166,7 @@
166
166
  if (!$menuButton) {
167
167
  return this;
168
168
  }
169
+ this.$root.classList.add('govuk-header--with-js-navigation');
169
170
  const menuId = $menuButton.getAttribute('aria-controls');
170
171
  if (!menuId) {
171
172
  throw new ElementError({
@@ -160,6 +160,7 @@ class Header extends Component {
160
160
  if (!$menuButton) {
161
161
  return this;
162
162
  }
163
+ this.$root.classList.add('govuk-header--with-js-navigation');
163
164
  const menuId = $menuButton.getAttribute('aria-controls');
164
165
  if (!menuId) {
165
166
  throw new ElementError({
@@ -24,6 +24,7 @@ class Header extends Component {
24
24
  if (!$menuButton) {
25
25
  return this;
26
26
  }
27
+ this.$root.classList.add('govuk-header--with-js-navigation');
27
28
  const menuId = $menuButton.getAttribute('aria-controls');
28
29
  if (!menuId) {
29
30
  throw new ElementError({