govuk_tech_docs 4.4.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/example/config/tech-docs.yml +3 -0
- data/lib/govuk_tech_docs/version.rb +1 -1
- data/lib/source/layouts/_footer.erb +15 -0
- data/lib/source/layouts/_header.erb +15 -13
- data/lib/source/layouts/core.erb +3 -3
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.js +8 -14
- data/node_modules/govuk-frontend/dist/govuk/all.bundle.mjs +8 -14
- data/node_modules/govuk-frontend/dist/govuk/assets/images/govuk-crest.svg +1 -1
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.ico +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/favicon.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-crest.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-180.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-192.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-512.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-icon-mask.svg +1 -0
- data/node_modules/govuk-frontend/dist/govuk/assets/rebrand/images/govuk-opengraph-image.png +0 -0
- data/node_modules/govuk-frontend/dist/govuk/common/govuk-frontend-version.mjs +1 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.js +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.mjs +4 -1
- data/node_modules/govuk-frontend/dist/govuk/components/cookie-banner/_index.scss +7 -1
- data/node_modules/govuk-frontend/dist/govuk/components/date-input/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.js +2 -12
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.bundle.mjs +2 -12
- data/node_modules/govuk-frontend/dist/govuk/components/file-upload/file-upload.mjs +2 -12
- data/node_modules/govuk-frontend/dist/govuk/components/footer/_index.scss +53 -9
- data/node_modules/govuk-frontend/dist/govuk/components/header/_index.scss +201 -11
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.js +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.bundle.mjs +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/header/header.mjs +1 -0
- data/node_modules/govuk-frontend/dist/govuk/components/service-navigation/_index.scss +23 -4
- data/node_modules/govuk-frontend/dist/govuk/core/_govuk-frontend-properties.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/govuk-frontend.min.js +1 -1
- data/node_modules/govuk-frontend/dist/govuk/helpers/_colour.scss +11 -0
- data/node_modules/govuk-frontend/dist/govuk/helpers/_focused.scss +14 -4
- data/node_modules/govuk-frontend/dist/govuk/helpers/_typography.scss +1 -1
- data/node_modules/govuk-frontend/dist/govuk/objects/_template.scss +5 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-applied.scss +39 -1
- data/node_modules/govuk-frontend/dist/govuk/settings/_colours-organisations.scss +0 -9
- data/node_modules/govuk-frontend/dist/govuk/tools/_index.scss +1 -0
- data/node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss +65 -0
- data/node_modules/govuk-frontend/dist/govuk-prototype-kit/functions.js +25 -0
- data/package-lock.json +7 -7
- data/package.json +1 -1
- metadata +11 -1
data/node_modules/govuk-frontend/dist/govuk/components/character-count/character-count.bundle.mjs
CHANGED
@@ -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.$
|
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.$
|
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
|
-
|
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
|
@@ -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-
|
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:
|
15
|
+
border-top: 10px solid $govuk-brand-colour;
|
16
16
|
color: $govuk-footer-text;
|
17
|
-
|
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
|
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
|
-
|
76
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
}
|
@@ -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({
|
@@ -1,6 +1,6 @@
|
|
1
1
|
@include govuk-exports("govuk/component/service-navigation") {
|
2
2
|
$govuk-service-navigation-active-link-border-width: govuk-spacing(1);
|
3
|
-
$govuk-service-navigation-background:
|
3
|
+
$govuk-service-navigation-background: govuk-colour("light-grey");
|
4
4
|
$govuk-service-navigation-border-colour: $govuk-border-colour;
|
5
5
|
|
6
6
|
// We make the link colour a little darker than normal here so that it has
|
@@ -8,8 +8,18 @@
|
|
8
8
|
$govuk-service-navigation-link-colour: govuk-shade($govuk-link-colour, 10%);
|
9
9
|
|
10
10
|
.govuk-service-navigation {
|
11
|
-
border-bottom: 1px
|
12
|
-
|
11
|
+
border-bottom-width: 1px;
|
12
|
+
border-bottom-style: solid;
|
13
|
+
@include _govuk-rebrand(
|
14
|
+
"border-bottom-color",
|
15
|
+
$from: $govuk-service-navigation-border-colour,
|
16
|
+
$to: $_govuk-rebrand-border-colour-on-blue-tint-95
|
17
|
+
);
|
18
|
+
@include _govuk-rebrand(
|
19
|
+
"background-color",
|
20
|
+
$from: $govuk-service-navigation-background,
|
21
|
+
$to: $_govuk-rebrand-template-background-colour
|
22
|
+
);
|
13
23
|
}
|
14
24
|
|
15
25
|
.govuk-service-navigation__container {
|
@@ -36,6 +46,11 @@
|
|
36
46
|
margin-bottom: 0;
|
37
47
|
padding: govuk-spacing(4) 0;
|
38
48
|
|
49
|
+
@include _govuk-rebrand {
|
50
|
+
padding: govuk-spacing(3) 0;
|
51
|
+
line-height: 1.5;
|
52
|
+
}
|
53
|
+
|
39
54
|
&:not(:last-child) {
|
40
55
|
@include govuk-responsive-margin(6, $direction: right);
|
41
56
|
}
|
@@ -52,7 +67,11 @@
|
|
52
67
|
}
|
53
68
|
|
54
69
|
@include govuk-media-query($from: tablet) {
|
55
|
-
|
70
|
+
@include _govuk-rebrand(
|
71
|
+
"padding-bottom",
|
72
|
+
$from: govuk-spacing(4) - $govuk-service-navigation-active-link-border-width,
|
73
|
+
$to: govuk-spacing(3) - $govuk-service-navigation-active-link-border-width
|
74
|
+
);
|
56
75
|
border-bottom-width: $govuk-service-navigation-active-link-border-width;
|
57
76
|
}
|
58
77
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
:root {
|
2
2
|
// This variable is automatically overwritten during builds and releases.
|
3
3
|
// It doesn't need to be updated manually.
|
4
|
-
--govuk-frontend-version: "5.
|
4
|
+
--govuk-frontend-version: "5.10.2";
|
5
5
|
|
6
6
|
// CSS custom property for each breakpoint
|
7
7
|
@each $name, $value in $govuk-breakpoints {
|