govuk_tech_docs 5.2.2 → 6.0.0.beta

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/CHANGELOG.md +15 -0
  4. data/README.md +11 -3
  5. data/example/config/tech-docs.yml +1 -1
  6. data/govuk_tech_docs.gemspec +1 -1
  7. data/lib/assets/stylesheets/_core.scss +1 -0
  8. data/lib/assets/stylesheets/_govuk_tech_docs.scss +13 -15
  9. data/lib/assets/stylesheets/modules/_app-pane.scss +3 -3
  10. data/lib/assets/stylesheets/modules/_page-review.scss +4 -4
  11. data/lib/assets/stylesheets/modules/_search.scss +3 -3
  12. data/lib/assets/stylesheets/modules/_service-navigation.scss +5 -0
  13. data/lib/assets/stylesheets/modules/_technical-documentation.scss +7 -7
  14. data/lib/assets/stylesheets/modules/_toc.scss +13 -13
  15. data/lib/assets/stylesheets/palette/_syntax-highlighting.scss +9 -7
  16. data/lib/govuk_tech_docs/meta_tags.rb +1 -1
  17. data/lib/govuk_tech_docs/version.rb +1 -1
  18. data/lib/source/layouts/_header.erb +2 -16
  19. data/lib/source/layouts/_service_navigation.erb +27 -0
  20. data/lib/source/layouts/core.erb +7 -7
  21. data/node_modules/govuk-frontend/dist/govuk/_base.scss +1 -0
  22. data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +87 -229
  23. data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +88 -229
  24. data/node_modules/govuk-frontend/dist/govuk/all.mjs +0 -1
  25. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.ico +0 -0
  26. data/node_modules/govuk-frontend/dist/govuk/assets/images/favicon.svg +1 -1
  27. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-180.png +0 -0
  28. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-192.png +0 -0
  29. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-icon-512.png +0 -0
  30. data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-opengraph-image.png +0 -0
  31. data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
  32. data/node_modules/govuk-frontend/dist/govuk/components/accordion/_index.scss +18 -15
  33. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js +1 -126
  34. data/node_modules/govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs +1 -126
  35. data/node_modules/govuk-frontend/dist/govuk/components/back-link/_index.scss +2 -2
  36. data/node_modules/govuk-frontend/dist/govuk/components/breadcrumbs/_index.scss +2 -2
  37. data/node_modules/govuk-frontend/dist/govuk/components/button/_index.scss +18 -21
  38. data/node_modules/govuk-frontend/dist/govuk/components/character-count/_index.scss +2 -2
  39. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +20 -135
  40. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +20 -135
  41. data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +19 -9
  42. data/node_modules/govuk-frontend/dist/govuk/components/checkboxes/_index.scss +7 -6
  43. data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +2 -5
  44. data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +5 -0
  45. data/node_modules/govuk-frontend/dist/govuk/components/details/_index.scss +6 -4
  46. data/node_modules/govuk-frontend/dist/govuk/components/error-message/_index.scss +1 -1
  47. data/node_modules/govuk-frontend/dist/govuk/components/error-summary/_index.scss +4 -2
  48. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/_index.scss +1 -1
  49. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.js +1 -126
  50. data/node_modules/govuk-frontend/dist/govuk/components/exit-this-page/exit-this-page.bundle.mjs +1 -126
  51. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/_index.scss +30 -38
  52. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +36 -132
  53. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +36 -132
  54. data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +35 -6
  55. data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +30 -27
  56. data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +89 -449
  57. data/node_modules/govuk-frontend/dist/govuk/components/hint/_index.scss +1 -1
  58. data/node_modules/govuk-frontend/dist/govuk/components/input/_index.scss +14 -20
  59. data/node_modules/govuk-frontend/dist/govuk/components/inset-text/_index.scss +2 -1
  60. data/node_modules/govuk-frontend/dist/govuk/components/notification-banner/_index.scss +10 -8
  61. data/node_modules/govuk-frontend/dist/govuk/components/pagination/_index.scss +12 -11
  62. data/node_modules/govuk-frontend/dist/govuk/components/panel/_index.scss +4 -4
  63. data/node_modules/govuk-frontend/dist/govuk/components/password-input/_index.scss +2 -2
  64. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.js +1 -126
  65. data/node_modules/govuk-frontend/dist/govuk/components/password-input/password-input.bundle.mjs +1 -126
  66. data/node_modules/govuk-frontend/dist/govuk/components/phase-banner/_index.scss +12 -6
  67. data/node_modules/govuk-frontend/dist/govuk/components/radios/_index.scss +8 -7
  68. data/node_modules/govuk-frontend/dist/govuk/components/select/_index.scss +6 -11
  69. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +55 -76
  70. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.js +30 -2
  71. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.bundle.mjs +30 -2
  72. data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/service-navigation.mjs +30 -2
  73. data/node_modules/govuk-frontend/dist/govuk/components/skip-link/_index.scss +7 -2
  74. data/node_modules/govuk-frontend/dist/govuk/components/summary-list/_index.scss +25 -21
  75. data/node_modules/govuk-frontend/dist/govuk/components/table/_index.scss +7 -8
  76. data/node_modules/govuk-frontend/dist/govuk/components/tabs/_index.scss +9 -6
  77. data/node_modules/govuk-frontend/dist/govuk/components/tag/_index.scss +66 -31
  78. data/node_modules/govuk-frontend/dist/govuk/components/task-list/_index.scss +7 -5
  79. data/node_modules/govuk-frontend/dist/govuk/components/textarea/_index.scss +5 -10
  80. data/node_modules/govuk-frontend/dist/govuk/components/warning-text/_index.scss +5 -4
  81. data/node_modules/govuk-frontend/dist/govuk/core/_index.scss +0 -1
  82. data/node_modules/govuk-frontend/dist/govuk/core/_lists.scss +2 -2
  83. data/node_modules/govuk-frontend/dist/govuk/core/_section-break.scss +2 -1
  84. data/node_modules/govuk-frontend/dist/govuk/core/_typography.scss +6 -20
  85. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_breakpoints.scss +17 -0
  86. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_frontend-version.scss +15 -0
  87. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_functional-colours.scss +17 -0
  88. data/node_modules/govuk-frontend/dist/govuk/custom-properties/_index.scss +5 -0
  89. data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
  90. data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +168 -82
  91. data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +41 -6
  92. data/node_modules/govuk-frontend/dist/govuk/helpers/_grid.scss +1 -1
  93. data/node_modules/govuk-frontend/dist/govuk/helpers/_links.scss +24 -40
  94. data/node_modules/govuk-frontend/dist/govuk/helpers/_media-queries.scss +172 -33
  95. data/node_modules/govuk-frontend/dist/govuk/helpers/_spacing.scss +1 -1
  96. data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +6 -30
  97. data/node_modules/govuk-frontend/dist/govuk/i18n.mjs +1 -126
  98. data/node_modules/govuk-frontend/dist/govuk/init.mjs +1 -2
  99. data/node_modules/govuk-frontend/dist/govuk/objects/_button-group.scss +1 -1
  100. data/node_modules/govuk-frontend/dist/govuk/objects/_form-group.scss +2 -1
  101. data/node_modules/govuk-frontend/dist/govuk/objects/_main-wrapper.scss +1 -1
  102. data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +3 -7
  103. data/node_modules/govuk-frontend/dist/govuk/objects/_width-container.scss +2 -2
  104. data/node_modules/govuk-frontend/dist/govuk/overrides/_display.scss +1 -1
  105. data/node_modules/govuk-frontend/dist/govuk/overrides/_typography.scss +0 -2
  106. data/node_modules/govuk-frontend/dist/govuk/overrides/_width.scss +5 -5
  107. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +3 -188
  108. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-functional.scss +366 -0
  109. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +9 -255
  110. data/node_modules/govuk-frontend/dist/govuk/settings/_colours-palette.scss +117 -25
  111. data/node_modules/govuk-frontend/dist/govuk/settings/_custom-properties.scss +18 -0
  112. data/node_modules/govuk-frontend/dist/govuk/settings/_index.scss +3 -14
  113. data/node_modules/govuk-frontend/dist/govuk/settings/_media-queries.scss +0 -9
  114. data/node_modules/govuk-frontend/dist/govuk/settings/_typography-responsive.scss +12 -189
  115. data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +0 -1
  116. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss +4 -2
  117. data/node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss +2 -0
  118. data/package-lock.json +3228 -4
  119. data/package.json +1 -1
  120. metadata +10 -26
  121. data/node_modules/govuk-frontend/dist/govuk/all.scss +0 -9
  122. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
  123. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +0 -1
  124. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +0 -1
  125. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
  126. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
  127. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
  128. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +0 -1
  129. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
  130. data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/manifest.json +0 -39
  131. data/node_modules/govuk-frontend/dist/govuk/components/_all.scss +0 -10
  132. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +0 -238
  133. data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +0 -230
  134. data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +0 -89
  135. data/node_modules/govuk-frontend/dist/govuk/core/_all.scss +0 -10
  136. data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +0 -15
  137. data/node_modules/govuk-frontend/dist/govuk/helpers/_all.scss +0 -10
  138. data/node_modules/govuk-frontend/dist/govuk/objects/_all.scss +0 -10
  139. data/node_modules/govuk-frontend/dist/govuk/overrides/_all.scss +0 -9
  140. data/node_modules/govuk-frontend/dist/govuk/settings/_all.scss +0 -10
  141. data/node_modules/govuk-frontend/dist/govuk/tools/_all.scss +0 -10
  142. data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +0 -65
  143. data/node_modules/govuk-frontend/dist/govuk/utilities/_all.scss +0 -10
  144. data/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss +0 -349
  145. data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +0 -25
@@ -1,235 +1,53 @@
1
1
  @include govuk-exports("govuk/component/header") {
2
- $govuk-header-background: govuk-colour("black");
3
- $govuk-header-border-color: $govuk-brand-colour;
4
- $govuk-header-border-width: govuk-spacing(2);
2
+ $govuk-header-background: govuk-functional-colour(brand);
5
3
  $govuk-header-text: govuk-colour("white");
6
- $govuk-header-link-active: #1d8feb;
7
- $govuk-header-nav-item-border-color: #2e3133;
8
4
  $govuk-header-link-underline-thickness: 3px;
9
- $govuk-header-vertical-spacing-value: 2;
10
- // This crown height is only used to calculate top offset of mobile menu button
11
- // as the crown svg height is the only thing that controls the height of the header
12
- $govuk-header-crown-height: 30px;
13
- $govuk-header-menu-button-height: 24px;
14
- $govuk-header-menu-button-width: 80px;
15
-
16
- $govuk-header-rebrand-background: $govuk-brand-colour;
17
- $govuk-header-rebrand-logo-bottom-margin: 2px;
5
+ $govuk-header-logo-bottom-margin: 2px;
18
6
 
19
7
  .govuk-header {
20
8
  @include govuk-font($size: 16, $line-height: 1);
21
9
 
22
10
  // 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
-
11
+ border-bottom: 1px solid transparent;
30
12
  color: $govuk-header-text;
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
- }
13
+ background: $govuk-header-background;
41
14
  }
42
15
 
43
16
  .govuk-header__container--full-width {
44
17
  padding: 0 govuk-spacing(3);
45
- border-color: $govuk-header-border-color;
46
-
47
- .govuk-header__menu-button {
48
- right: govuk-spacing(3);
49
- }
50
- }
51
-
52
- .govuk-header__container {
53
- @include govuk-clearfix;
54
- position: relative;
55
- margin-bottom: -$govuk-header-border-width;
56
- padding-top: govuk-spacing($govuk-header-vertical-spacing-value);
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
- }
69
- }
70
-
71
- // TODO: Remove this when _govuk-rebrand becomes the default
72
- .govuk-header--full-width-border {
73
- border-bottom-color: $govuk-header-border-color;
74
-
75
- .govuk-header__container {
76
- border-bottom-color: transparent;
77
- }
78
18
  }
79
19
 
80
- .govuk-header__logotype {
81
- display: inline-block;
82
- position: relative;
83
- top: -3px;
84
-
85
- // Add a gap after the logo in case it's followed by a product name. This
86
- // gets removed later if the logotype is a :last-child.
87
- margin-right: govuk-spacing(1);
88
- fill: currentcolor;
89
- vertical-align: top;
90
-
91
- // Prevent readability backplate from obscuring underline in Windows High
92
- // Contrast Mode
93
- @media (forced-colors: active) {
94
- forced-color-adjust: none;
95
- color: linktext;
96
- }
97
-
98
- // Remove the gap after the logo if there's no product name to keep hover
99
- // and focus states neat
100
- &:last-child {
101
- margin-right: 0;
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
- }
133
- }
134
-
135
- .govuk-header__product-name {
136
- $product-name-offset: if($govuk-new-typography-scale, 7px, 10px);
137
- $product-name-offset-tablet: 5px;
138
-
139
- @include govuk-font-size($size: 24, $line-height: 1);
140
- @include govuk-typography-weight-regular;
141
- display: inline-table;
142
-
143
- // Maintain space below logo when wrapped
144
- margin-top: $product-name-offset;
145
-
146
- // Firefox places the GOV.UK logo one pixel higher, due to how it rounds
147
- // subpixels, so nudge the product name in FF to still be aligned.
148
- @-moz-document url-prefix() {
149
- margin-top: $product-name-offset - 0.5px;
150
- }
151
-
152
- // Align vertically with logo when not wrapped
153
- vertical-align: top;
154
-
155
- @include govuk-media-query($from: tablet) {
156
- margin-top: $product-name-offset-tablet;
157
- @-moz-document url-prefix() {
158
- margin-top: $product-name-offset-tablet - 0.5px;
159
- }
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
- }
20
+ .govuk-header__logo {
21
+ box-sizing: border-box;
190
22
 
191
- @include govuk-media-query($from: desktop) {
192
- margin-top: 0;
193
- }
194
- }
23
+ // Magic numbers, set padding to vertically centre align the logo
24
+ padding-top: 16px;
25
+ padding-bottom: 14px - $govuk-header-logo-bottom-margin;
195
26
  }
196
27
 
197
- .govuk-header__link {
198
- // Avoid using the `govuk-link-common` mixin because the links in the header
199
- // get a special treatment, because:
28
+ .govuk-header__homepage-link {
29
+ // Avoid using the `govuk-link-common` mixin because the links in the
30
+ // header get a special treatment, because:
200
31
  //
201
32
  // - underlines are only visible on hover
202
33
  // - all links get a 3px underline regardless of text size, as there are
203
34
  // multiple grouped elements close to one another and having slightly
204
35
  // different underline widths looks unbalanced
205
- @include govuk-link-style-inverse;
206
-
207
- text-decoration: none;
208
-
209
- &:hover {
210
- text-decoration: underline;
211
- text-decoration-thickness: $govuk-header-link-underline-thickness;
212
-
213
- @if $govuk-link-underline-offset {
214
- text-underline-offset: $govuk-link-underline-offset;
215
- }
216
- }
217
-
218
- &:focus {
219
- @include govuk-focused-text;
220
- }
221
- }
222
-
223
- .govuk-header__link--homepage {
36
+ //
224
37
  // Font size needs to be set on the link so that the box sizing is correct
225
38
  // in Firefox
226
- display: inline-block;
39
+ display: inline;
227
40
  margin-right: govuk-spacing(2);
228
41
  font-size: 30px; // We don't have a mixin that produces 30px font size
229
-
230
- @include govuk-media-query($from: desktop) {
231
- display: inline;
42
+ text-decoration: none;
43
+ // Remove word-spacing from within the logo so we can ignore
44
+ // whitespace characters in the HTML
45
+ word-spacing: govuk-px-to-rem(-6px);
46
+ // Reset word-spacing for child elements
47
+ > * {
48
+ word-spacing: 0;
232
49
  }
50
+ @include govuk-link-style-inverse;
233
51
 
234
52
  &:link,
235
53
  &:visited {
@@ -243,104 +61,9 @@
243
61
  border-bottom: $govuk-header-link-underline-thickness solid;
244
62
  }
245
63
 
246
- // Remove any borders that show when focused and hovered.
247
- &:focus {
248
- margin-bottom: 0;
249
- border-bottom: 0;
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
- }
268
- }
269
-
270
- .govuk-header__service-name {
271
- display: inline-block;
272
- margin-bottom: govuk-spacing(2);
273
- @include govuk-font-size($size: 24);
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
- }
287
- }
288
-
289
- .govuk-header__logo,
290
- .govuk-header__content {
291
- box-sizing: border-box;
292
- }
293
-
294
- .govuk-header__logo {
295
- @include govuk-responsive-margin($govuk-header-vertical-spacing-value, "bottom");
296
-
297
- @include govuk-media-query($from: desktop) {
298
- width: 33.33%;
299
- padding-right: $govuk-gutter-half;
300
- float: left;
301
- vertical-align: top;
302
-
303
- // Reset float when logo is the last child, without a navigation
304
- &:last-child {
305
- width: auto;
306
- padding-right: 0;
307
- float: none;
308
- }
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
- }
319
- }
320
-
321
- .govuk-header__content {
322
- @include govuk-media-query($from: desktop) {
323
- width: 66.66%;
324
- padding-left: $govuk-gutter-half;
325
- float: left;
326
- }
327
- }
328
-
329
- .govuk-header__menu-button {
330
- @include govuk-font($size: 16);
331
- max-width: $govuk-header-menu-button-width;
332
- min-height: $govuk-header-menu-button-height;
333
- margin-bottom: govuk-spacing(1);
334
- padding: 0;
335
- border: 0;
336
- color: govuk-colour("white");
337
- background: none;
338
- word-break: break-all;
339
- cursor: pointer;
340
-
341
64
  &:hover {
342
- -webkit-text-decoration: solid underline $govuk-header-link-underline-thickness;
343
- text-decoration: solid underline $govuk-header-link-underline-thickness;
65
+ text-decoration: underline;
66
+ text-decoration-thickness: $govuk-header-link-underline-thickness;
344
67
 
345
68
  @if $govuk-link-underline-offset {
346
69
  text-underline-offset: $govuk-link-underline-offset;
@@ -348,190 +71,100 @@
348
71
  }
349
72
 
350
73
  &:focus {
351
- @include govuk-focused-text;
352
- }
353
-
354
- &::after {
355
- @include govuk-shape-arrow($direction: down, $base: 10px, $display: inline-block);
356
- content: "";
357
- margin-left: govuk-spacing(1);
358
- }
359
-
360
- &[aria-expanded="true"]::after {
361
- @include govuk-shape-arrow($direction: up, $base: 10px, $display: inline-block);
362
- }
363
-
364
- @include govuk-media-query($from: mobile) {
365
- position: absolute;
366
- // calculate top offset by:
367
- // - getting the vertical spacing for the top and the bottom of the header
368
- // - adding that to the crown height
369
- // - dividing it by 2 so you have the vertical centre of the header
370
- // - subtracting half the height of the menu button
371
- top: (((govuk-spacing($govuk-header-vertical-spacing-value) * 2) + $govuk-header-crown-height) / 2) -
372
- ($govuk-header-menu-button-height / 2);
373
- right: 0;
374
- margin: 0;
375
- }
376
-
377
- @include govuk-media-query($from: tablet) {
378
- top: govuk-spacing(3);
379
- }
74
+ // Remove any borders that show when focused and hovered.
75
+ margin-bottom: 0;
76
+ border-bottom: 0;
380
77
 
381
- .govuk-frontend-supported & {
382
- display: block;
78
+ @include govuk-focused-text;
383
79
  }
384
80
 
385
- &[hidden],
386
- .govuk-frontend-supported &[hidden] {
387
- display: none;
81
+ &:not(:focus) {
82
+ background-color: $govuk-header-background;
388
83
  }
389
84
  }
390
85
 
391
- .govuk-header__navigation {
392
- @include govuk-media-query($until: mobile) {
393
- @include _govuk-rebrand {
394
- padding-bottom: govuk-spacing(3);
395
- }
396
- }
397
-
398
- @include govuk-media-query($from: desktop) {
399
- margin-bottom: govuk-spacing(2);
86
+ .govuk-header__logotype {
87
+ display: inline-block;
88
+ position: relative;
89
+ top: -3px;
400
90
 
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;
91
+ // Add a gap after the logo in case it's followed by a product name. This
92
+ // gets removed later if the logotype is a :last-child.
93
+ margin-right: govuk-px-to-rem(7px); // 1 'dot'
94
+ // Add bottom margin to space Product name on small viewports
95
+ margin-bottom: $govuk-header-logo-bottom-margin;
96
+ fill: currentcolor;
97
+ vertical-align: top;
405
98
 
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
- }
99
+ // Prevent readability backplate from obscuring underline in Windows High
100
+ // Contrast Mode
101
+ @media (forced-colors: active) {
102
+ forced-color-adjust: none;
103
+ color: linktext;
410
104
  }
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
105
 
420
- // Restore the full bottom padding as the navigation isn't standalone
421
- padding-bottom: govuk-spacing(3);
422
- }
106
+ // Remove the gap after the logo if there's no product name to keep hover
107
+ // and focus states neat
108
+ &:last-child {
109
+ margin-right: 0;
423
110
  }
424
111
  }
425
112
 
426
- .govuk-header__navigation-list {
427
- // Reset user-agent default list styles
428
- margin: 0;
429
- padding: 0;
430
- list-style: none;
113
+ // Colour in the Dot
114
+ .govuk-logo-dot {
115
+ fill: govuk-colour("teal", "accent");
431
116
 
432
- &[hidden] {
433
- display: none;
117
+ // Override Dot colour when printing
118
+ @media print {
119
+ fill: currentcolor;
434
120
  }
435
121
 
436
- @include _govuk-rebrand {
437
- @include govuk-media-query($from: mobile, $until: desktop) {
438
- padding-bottom: govuk-spacing(3);
439
- }
122
+ // Override Dot colour on forced colours mode
123
+ @media (forced-colors: active) {
124
+ fill: currentcolor;
440
125
  }
441
- }
442
126
 
443
- .govuk-header__navigation--end {
444
- @include govuk-media-query($from: desktop) {
445
- margin: 0;
446
- padding: govuk-spacing(1) 0;
447
- text-align: right;
127
+ // Override Dot colour on focus
128
+ :focus & {
129
+ fill: currentcolor;
448
130
  }
449
131
  }
450
132
 
451
- .govuk-header__navigation-item {
452
- padding: govuk-spacing(2) 0;
453
- border-bottom: 1px solid $govuk-header-nav-item-border-color;
454
-
455
- @include govuk-media-query($from: desktop) {
456
- display: inline-block;
457
- margin-right: govuk-spacing(3);
458
- padding: govuk-spacing(1) 0;
459
- border: 0;
460
- }
461
-
462
- a {
463
- @include govuk-font-size($size: 16);
464
- @include govuk-typography-weight-bold;
465
- white-space: nowrap;
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
- }
133
+ .govuk-header__product-name {
134
+ display: inline-table;
476
135
 
477
- // Change the dividing line colour between mobile nav items
478
- border-bottom-color: govuk-colour("white");
136
+ // Remove 1px from the bottom to account for the font-size being 1px
137
+ // larger than the logo height.
138
+ margin-bottom: govuk-px-to-rem(-1px);
479
139
 
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
- }
485
- }
140
+ // Magic number font-size that visually aligns with GOV.UK logo.
141
+ // Also stops reducing the product name size on narrow screens
142
+ font-size: govuk-px-to-rem(31px);
486
143
 
487
- .govuk-header__navigation-item--active {
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
- }
144
+ // Reduce letter spacing
145
+ letter-spacing: -0.015em;
493
146
 
494
- &:link,
495
- &:hover,
496
- &:visited {
497
- color: $govuk-header-link-active;
498
-
499
- @include _govuk-rebrand {
500
- color: inherit;
501
- }
502
- }
503
-
504
- // When printing, use the normal blue as this contrasts better with the
505
- // white printing header
506
- @include govuk-media-query($media-type: print) {
507
- color: $govuk-brand-colour;
508
- }
147
+ // Align vertically with logo when not wrapped
148
+ vertical-align: top;
509
149
 
510
- // When focussed, the text colour needs to be darker to ensure that colour
511
- // contrast is still acceptable
512
- &:focus {
513
- color: $govuk-focus-text-colour;
150
+ // Prevent forced colour modes from applying a background colour behind
151
+ // the product name, which cuts off the underline that appears on hover.
152
+ forced-color-adjust: none;
514
153
 
515
- @include _govuk-rebrand {
516
- color: $govuk-focus-text-colour;
517
- }
518
- }
154
+ @media screen and (forced-colors: active) {
155
+ color: LinkText;
156
+ background: transparent;
519
157
  }
520
158
  }
521
159
 
522
- .govuk-header__navigation-item:last-child {
523
- margin-right: 0;
524
- border-bottom: 0;
525
- }
526
-
527
- @include govuk-media-query($media-type: print) {
160
+ @media print {
528
161
  .govuk-header {
529
162
  border-bottom-width: 0;
530
163
  color: govuk-colour("black");
531
164
  background: transparent;
532
165
  }
533
166
 
534
- .govuk-header__link {
167
+ .govuk-header__homepage-link {
535
168
  &:link,
536
169
  &:visited {
537
170
  color: govuk-colour("black");
@@ -542,6 +175,13 @@
542
175
  display: none;
543
176
  }
544
177
  }
178
+
179
+ .govuk-header__product-name {
180
+ // Fix product name alignment in Firefox when printing
181
+ @-moz-document url-prefix() {
182
+ margin-top: 2px;
183
+ }
184
+ }
545
185
  }
546
186
  }
547
187
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  margin-bottom: govuk-spacing(3);
6
6
 
7
- color: $govuk-secondary-text-colour;
7
+ color: govuk-functional-colour(secondary-text);
8
8
  }
9
9
 
10
10
  // Reduces margin-bottom of hint when used after the default label (no class)