katalyst-govuk-formbuilder 1.17.1 → 1.18.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f533b02ace5d03ada9bc15c4948ef6e0beea18ab3c8220fb477764d1a10ef9d
4
- data.tar.gz: db67628ba4fc937998a6e6578a90e29623e648eb18f32df4d96308559c31f43c
3
+ metadata.gz: a178eb2f8c15cf5feae7f1d8b54aeea17fc2bd403075a33e9d0eefb59d0a1d78
4
+ data.tar.gz: d7e76e1752f0fbfb86ba5d4acabf12b66d902ceeb07d82b137bf1d9076454f0d
5
5
  SHA512:
6
- metadata.gz: a1030240f63d0c1c00b4380f6e866830d630c476f88832b20cebf4a82c9bcfd240a2ecf8c857d29d7a17f3ac36233d24acff7190426910fb10e0cd91b5e75abd
7
- data.tar.gz: f0166f1c7f2ce2c447a24989ad654abedcb6acc23ecc3d58519e55a9765bbda5b8393663c9ec6dba3e09f1b47b70165afc82b23382de1d3d01d3c3b091460ccd
6
+ metadata.gz: 32fec79b423b236ccf044c9f4f30300971e32c9c76a158439219193ffbd2b5e021524849c8efe9018b4f56627c0b633be46c9512e8e7ec329b4d73d6bd7fbdf4
7
+ data.tar.gz: 2809bae41bc0b7b99fc77a11d92a21f71e06019ee29a41ff06b8d3444f3ec50fbdd99804adf317b8d55f4a1d0e59b1f6db820aae744e1c4872be35a639afa916
@@ -43,10 +43,11 @@
43
43
 
44
44
 
45
45
 
46
+
46
47
 
47
48
 
48
49
  :root {
49
- --govuk-frontend-version: "5.9.0";
50
+ --govuk-frontend-version: "5.10.2";
50
51
  --govuk-frontend-breakpoint-mobile: 20rem;
51
52
  --govuk-frontend-breakpoint-tablet: 40.0625rem;
52
53
  --govuk-frontend-breakpoint-desktop: 48.0625rem;
@@ -79,8 +80,12 @@
79
80
  background-color: #ffdd00;
80
81
  box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
81
82
  text-decoration: none;
82
- -webkit-box-decoration-break: clone;
83
- box-decoration-break: clone;
83
+ }
84
+ @supports not (text-wrap: balance) {
85
+ .govuk-link:focus {
86
+ -webkit-box-decoration-break: clone;
87
+ box-decoration-break: clone;
88
+ }
84
89
  }
85
90
  .govuk-link:link {
86
91
  color: #1d70b8;
@@ -809,6 +814,7 @@
809
814
 
810
815
 
811
816
 
817
+
812
818
 
813
819
 
814
820
  .govuk-button-group {
@@ -916,6 +922,7 @@
916
922
 
917
923
 
918
924
 
925
+
919
926
 
920
927
 
921
928
  .govuk-form-group {
@@ -989,6 +996,7 @@
989
996
 
990
997
 
991
998
 
999
+
992
1000
 
993
1001
 
994
1002
  .govuk-grid-row {
@@ -1184,6 +1192,7 @@
1184
1192
 
1185
1193
 
1186
1194
 
1195
+
1187
1196
 
1188
1197
 
1189
1198
  .govuk-main-wrapper {
@@ -1254,6 +1263,7 @@
1254
1263
 
1255
1264
 
1256
1265
 
1266
+
1257
1267
 
1258
1268
 
1259
1269
  .govuk-template {
@@ -1262,6 +1272,10 @@
1262
1272
  -moz-text-size-adjust: 100%;
1263
1273
  text-size-adjust: 100%;
1264
1274
  }
1275
+ .govuk-template--rebranded {
1276
+ background-color: #f4f8fb;
1277
+ }
1278
+
1265
1279
  @supports (position: -webkit-sticky) or (position: sticky) {
1266
1280
  .govuk-template {
1267
1281
  scroll-padding-top: 60px;
@@ -1326,6 +1340,7 @@
1326
1340
 
1327
1341
 
1328
1342
 
1343
+
1329
1344
 
1330
1345
 
1331
1346
  .govuk-width-container {
@@ -2064,6 +2079,7 @@
2064
2079
 
2065
2080
 
2066
2081
 
2082
+
2067
2083
  .govuk-date-input {
2068
2084
  font-size: 0;
2069
2085
  }
@@ -2213,8 +2229,12 @@
2213
2229
  background-color: #ffdd00;
2214
2230
  box-shadow: 0 -2px #ffdd00, 0 4px #0b0c0c;
2215
2231
  text-decoration: none;
2216
- -webkit-box-decoration-break: clone;
2217
- box-decoration-break: clone;
2232
+ }
2233
+ @supports not (text-wrap: balance) {
2234
+ .govuk-error-summary__list a:focus {
2235
+ -webkit-box-decoration-break: clone;
2236
+ box-decoration-break: clone;
2237
+ }
2218
2238
  }
2219
2239
  .govuk-error-summary__list a:link, .govuk-error-summary__list a:visited {
2220
2240
  color: #d4351c;
@@ -623,6 +623,7 @@ class CharacterCount extends ConfigurableComponent {
623
623
  identifier: `Count message (\`id="${textareaDescriptionId}"\`)`
624
624
  });
625
625
  }
626
+ this.$errorMessage = this.$root.querySelector('.govuk-error-message');
626
627
  if (`${$textareaDescription.textContent}`.match(/^\s*$/)) {
627
628
  $textareaDescription.textContent = this.i18n.t('textareaDescription', {
628
629
  count: this.maxLength
@@ -681,7 +682,9 @@ class CharacterCount extends ConfigurableComponent {
681
682
  const remainingNumber = this.maxLength - this.count(this.$textarea.value);
682
683
  const isError = remainingNumber < 0;
683
684
  this.$visibleCountMessage.classList.toggle('govuk-character-count__message--disabled', !this.isOverThreshold());
684
- this.$textarea.classList.toggle('govuk-textarea--error', isError);
685
+ if (!this.$errorMessage) {
686
+ this.$textarea.classList.toggle('govuk-textarea--error', isError);
687
+ }
685
688
  this.$visibleCountMessage.classList.toggle('govuk-error-message', isError);
686
689
  this.$visibleCountMessage.classList.toggle('govuk-hint', !isError);
687
690
  this.$visibleCountMessage.textContent = this.getCountMessage();
@@ -18,7 +18,7 @@ class f extends l{constructor(e,t={}){super(e,t),this.debounceFormSubmitTimer=nu
18
18
  *
19
19
  * @preserve
20
20
  * @augments ConfigurableComponent<CharacterCountConfig>
21
- */f.moduleName="govuk-button",f.defaults=Object.freeze({preventDoubleClick:!1}),f.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class v extends l{[c](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var o,s;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const a=this.$root.querySelector(".govuk-js-character-count");if(!(a instanceof HTMLTextAreaElement||a instanceof HTMLInputElement))throw new r({component:v,element:a,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const u=function(e,t){const n=[];for(const[o,s]of Object.entries(e)){const e=[];if(Array.isArray(s)){for(const{required:n,errorMessage:o}of s)n.every((e=>!!t[e]))||e.push(o);"anyOf"!==o||s.length-e.length>=1||n.push(...e)}}return n}(v.schema,this.config);if(u[0])throw new i(n(v,u[0]));this.i18n=new m(this.config.i18n,{locale:g(this.$root,"lang")}),this.maxLength=null!=(o=null!=(s=this.config.maxwords)?s:this.config.maxlength)?o:1/0,this.$textarea=a;const c=`${this.$textarea.id}-info`,l=document.getElementById(c);if(!l)throw new r({component:v,element:l,identifier:`Count message (\`id="${c}"\`)`});`${l.textContent}`.match(/^\s*$/)&&(l.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",l);const h=document.createElement("div");h.className="govuk-character-count__sr-status govuk-visually-hidden",h.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=h,l.insertAdjacentElement("afterend",h);const d=document.createElement("div");d.className=l.className,d.classList.add("govuk-character-count__status"),d.setAttribute("aria-hidden","true"),this.$visibleCountMessage=d,l.insertAdjacentElement("afterend",d),l.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){if(this.config.maxwords){var t;return(null!=(t=e.match(/\S+/g))?t:[]).length}return e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}v.moduleName="govuk-character-count",v.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),v.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});
21
+ */f.moduleName="govuk-button",f.defaults=Object.freeze({preventDoubleClick:!1}),f.schema=Object.freeze({properties:{preventDoubleClick:{type:"boolean"}}});class v extends l{[c](e){let t={};return("maxwords"in e||"maxlength"in e)&&(t={maxlength:void 0,maxwords:void 0}),t}constructor(e,t={}){var o,s;super(e,t),this.$textarea=void 0,this.$visibleCountMessage=void 0,this.$screenReaderCountMessage=void 0,this.lastInputTimestamp=null,this.lastInputValue="",this.valueChecker=null,this.i18n=void 0,this.maxLength=void 0;const a=this.$root.querySelector(".govuk-js-character-count");if(!(a instanceof HTMLTextAreaElement||a instanceof HTMLInputElement))throw new r({component:v,element:a,expectedType:"HTMLTextareaElement or HTMLInputElement",identifier:"Form field (`.govuk-js-character-count`)"});const u=function(e,t){const n=[];for(const[o,s]of Object.entries(e)){const e=[];if(Array.isArray(s)){for(const{required:n,errorMessage:o}of s)n.every((e=>!!t[e]))||e.push(o);"anyOf"!==o||s.length-e.length>=1||n.push(...e)}}return n}(v.schema,this.config);if(u[0])throw new i(n(v,u[0]));this.i18n=new m(this.config.i18n,{locale:g(this.$root,"lang")}),this.maxLength=null!=(o=null!=(s=this.config.maxwords)?s:this.config.maxlength)?o:1/0,this.$textarea=a;const c=`${this.$textarea.id}-info`,l=document.getElementById(c);if(!l)throw new r({component:v,element:l,identifier:`Count message (\`id="${c}"\`)`});this.$errorMessage=this.$root.querySelector(".govuk-error-message"),`${l.textContent}`.match(/^\s*$/)&&(l.textContent=this.i18n.t("textareaDescription",{count:this.maxLength})),this.$textarea.insertAdjacentElement("afterend",l);const h=document.createElement("div");h.className="govuk-character-count__sr-status govuk-visually-hidden",h.setAttribute("aria-live","polite"),this.$screenReaderCountMessage=h,l.insertAdjacentElement("afterend",h);const d=document.createElement("div");d.className=l.className,d.classList.add("govuk-character-count__status"),d.setAttribute("aria-hidden","true"),this.$visibleCountMessage=d,l.insertAdjacentElement("afterend",d),l.classList.add("govuk-visually-hidden"),this.$textarea.removeAttribute("maxlength"),this.bindChangeEvents(),window.addEventListener("pageshow",(()=>this.updateCountMessage())),this.updateCountMessage()}bindChangeEvents(){this.$textarea.addEventListener("keyup",(()=>this.handleKeyUp())),this.$textarea.addEventListener("focus",(()=>this.handleFocus())),this.$textarea.addEventListener("blur",(()=>this.handleBlur()))}handleKeyUp(){this.updateVisibleCountMessage(),this.lastInputTimestamp=Date.now()}handleFocus(){this.valueChecker=window.setInterval((()=>{(!this.lastInputTimestamp||Date.now()-500>=this.lastInputTimestamp)&&this.updateIfValueChanged()}),1e3)}handleBlur(){this.valueChecker&&window.clearInterval(this.valueChecker)}updateIfValueChanged(){this.$textarea.value!==this.lastInputValue&&(this.lastInputValue=this.$textarea.value,this.updateCountMessage())}updateCountMessage(){this.updateVisibleCountMessage(),this.updateScreenReaderCountMessage()}updateVisibleCountMessage(){const e=this.maxLength-this.count(this.$textarea.value)<0;this.$visibleCountMessage.classList.toggle("govuk-character-count__message--disabled",!this.isOverThreshold()),this.$errorMessage||this.$textarea.classList.toggle("govuk-textarea--error",e),this.$visibleCountMessage.classList.toggle("govuk-error-message",e),this.$visibleCountMessage.classList.toggle("govuk-hint",!e),this.$visibleCountMessage.textContent=this.getCountMessage()}updateScreenReaderCountMessage(){this.isOverThreshold()?this.$screenReaderCountMessage.removeAttribute("aria-hidden"):this.$screenReaderCountMessage.setAttribute("aria-hidden","true"),this.$screenReaderCountMessage.textContent=this.getCountMessage()}count(e){if(this.config.maxwords){var t;return(null!=(t=e.match(/\S+/g))?t:[]).length}return e.length}getCountMessage(){const e=this.maxLength-this.count(this.$textarea.value),t=this.config.maxwords?"words":"characters";return this.formatCountMessage(e,t)}formatCountMessage(e,t){if(0===e)return this.i18n.t(`${t}AtLimit`);const n=e<0?"OverLimit":"UnderLimit";return this.i18n.t(`${t}${n}`,{count:Math.abs(e)})}isOverThreshold(){if(!this.config.threshold)return!0;const e=this.count(this.$textarea.value);return this.maxLength*this.config.threshold/100<=e}}v.moduleName="govuk-character-count",v.defaults=Object.freeze({threshold:0,i18n:{charactersUnderLimit:{one:"You have %{count} character remaining",other:"You have %{count} characters remaining"},charactersAtLimit:"You have 0 characters remaining",charactersOverLimit:{one:"You have %{count} character too many",other:"You have %{count} characters too many"},wordsUnderLimit:{one:"You have %{count} word remaining",other:"You have %{count} words remaining"},wordsAtLimit:"You have 0 words remaining",wordsOverLimit:{one:"You have %{count} word too many",other:"You have %{count} words too many"},textareaDescription:{other:""}}}),v.schema=Object.freeze({properties:{i18n:{type:"object"},maxwords:{type:"number"},maxlength:{type:"number"},threshold:{type:"number"}},anyOf:[{required:["maxwords"],errorMessage:'Either "maxlength" or "maxwords" must be provided'},{required:["maxlength"],errorMessage:'Either "maxlength" or "maxwords" must be provided'}]});
22
22
  /**
23
23
  * Checkboxes component
24
24
  *
@@ -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 {
@@ -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
  }
@@ -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: $govuk-canvas-background-colour;
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 solid $govuk-service-navigation-border-colour;
12
- background-color: $govuk-service-navigation-background;
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
- padding-bottom: govuk-spacing(4) - $govuk-service-navigation-active-link-border-width;
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.9.0";
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 {
@@ -66,6 +66,17 @@
66
66
  @error "Unknown organisation `#{$organisation}`";
67
67
  }
68
68
 
69
+ // Output a deprecation warning if the legacy colour palette is being used.
70
+ // Remove in next major version.
71
+ $is-legacy: $govuk-colours-organisations == $_govuk-legacy-organisation-colours;
72
+ @if $is-legacy and _should-warn("legacy-organisation-colours") {
73
+ @warn _warning-text("legacy-organisation-colours",
74
+ "We've updated the organisation colour palette. Opt in to the new " +
75
+ "colours using `$govuk-new-organisation-colours: true`. The old " +
76
+ "palette is deprecated and we'll remove it in the next major version."
77
+ );
78
+ }
79
+
69
80
  // Output a warning if $websafe is set.
70
81
  @if $websafe and _should-warn("organisation-colour-websafe-param") {
71
82
  @warn _warning-text("organisation-colour-websafe-param",
@@ -24,10 +24,20 @@
24
24
  // box shadow adds the "underline"
25
25
  text-decoration: none;
26
26
 
27
- // When a focused box is broken by e.g. a line break, ensure that the
28
- // box-shadow is applied to each fragment independently.
29
- -webkit-box-decoration-break: clone;
30
- box-decoration-break: clone;
27
+ // Fixes an issue in Chromium 108–111 where the box-shadow on the focus state
28
+ // is missing on links that wrap across multiple lines [1].
29
+ //
30
+ // However, text-wrap: balance doesn't play nicely with box-decoration-break:
31
+ // clone, causing links to re-flow when focused [2]. As text-wrap: balance
32
+ // wasn't introduced until Chromium 114 we can use it as a way to target
33
+ // this fix to just 108–111.
34
+ //
35
+ // [1]: http://crbug.com/40884971
36
+ // [2]: https://github.com/alphagov/govuk-frontend/issues/5878
37
+ @supports not (text-wrap: balance) {
38
+ -webkit-box-decoration-break: clone;
39
+ box-decoration-break: clone;
40
+ }
31
41
  }
32
42
 
33
43
  /// Focused box
@@ -190,7 +190,7 @@
190
190
  // No match? Try with string type (e.g. $size: "16" not 16)
191
191
  @if not $font-map {
192
192
  @each $font-size in map-keys($govuk-typography-scale) {
193
- @if not $font-map and #{$font-size} == #{$size} {
193
+ @if not $font-map and "#{$font-size}" == "#{$size}" {
194
194
  $font-map: map-get($govuk-typography-scale, $font-size);
195
195
  }
196
196
  }
@@ -5,7 +5,11 @@
5
5
  .govuk-template {
6
6
  // Set the overall page background colour to the same colour as used by the
7
7
  // footer to give the illusion of a long footer.
8
- background-color: $govuk-canvas-background-colour;
8
+ @include _govuk-rebrand(
9
+ background-color,
10
+ $from: $govuk-template-background-colour,
11
+ $to: $_govuk-rebrand-template-background-colour
12
+ );
9
13
 
10
14
  // Prevent automatic text sizing, as we already cater for small devices and
11
15
  // would like the browser to stay on 100% text zoom by default.
@@ -29,9 +29,31 @@ $govuk-text-colour: govuk-colour("black") !default;
29
29
  ///
30
30
  /// @type Colour
31
31
  /// @access public
32
-
32
+ /// @deprecated "$govuk-canvas-background-colour has been deprecated and will be removed in the next major
33
+ /// version. Use `$govuk-template-background-colour` if you want to change the background of
34
+ /// the `<html>` element and background colour of elements that need to match for visual
35
+ /// continuity.
33
36
  $govuk-canvas-background-colour: govuk-colour("light-grey") !default;
34
37
 
38
+ // Output a deprecation warning if $govuk-canvas-background-colour is being overridden
39
+ // Remove in next major version.
40
+ @if $govuk-canvas-background-colour != govuk-colour("light-grey") {
41
+ @include _warning(
42
+ "$govuk-canvas-background-colour",
43
+ "$govuk-canvas-background-colour has been deprecated and will be removed in the next major version."
44
+ );
45
+ }
46
+
47
+ /// Template background colour
48
+ ///
49
+ /// Used by components that want to give the illusion of extending
50
+ /// the template background (such as the footer and cookie banner).
51
+ ///
52
+ /// @type Colour
53
+ /// @access public
54
+
55
+ $govuk-template-background-colour: govuk-colour("light-grey") !default;
56
+
35
57
  /// Body background colour
36
58
  ///
37
59
  /// @type Colour
@@ -154,4 +176,20 @@ $govuk-link-hover-colour: govuk-colour("dark-blue") !default;
154
176
 
155
177
  $govuk-link-active-colour: govuk-colour("black") !default;
156
178
 
179
+ // =============================================================================
180
+ // Brand refresh
181
+ // =============================================================================
182
+
183
+ /// Updated template background colour
184
+ ///
185
+ /// @type Colour
186
+ /// @access private
187
+ $_govuk-rebrand-template-background-colour: #f4f8fb; // Blue tint 95%
188
+
189
+ /// Border colour for areas on a light-blue background
190
+ ///
191
+ /// @type Colour
192
+ /// @access private
193
+ $_govuk-rebrand-border-colour-on-blue-tint-95: #8eb8dc; // Blue tint 50%
194
+
157
195
  /*# sourceMappingURL=_colours-applied.scss.map */
@@ -359,15 +359,6 @@ $govuk-colours-organisations: $_govuk-legacy-organisation-colours !default;
359
359
  $govuk-colours-organisations: $_govuk-organisation-colours;
360
360
  }
361
361
 
362
- // Output a deprecation warning if the legacy colour palette is being used.
363
- // Remove in next major version.
364
- @if $govuk-colours-organisations == $_govuk-legacy-organisation-colours {
365
- @include _warning(
366
- "legacy-organisation-colours",
367
- "The legacy organisation colour palette has been deprecated and will be removed in the next major version."
368
- );
369
- }
370
-
371
362
  /// Organisation colour aliases
372
363
  ///
373
364
  /// Some organisations have been renamed within our code over time. Here we
@@ -3,5 +3,6 @@
3
3
  @import "image-url";
4
4
  @import "px-to-em";
5
5
  @import "px-to-rem";
6
+ @import "rebrand";
6
7
 
7
8
  /*# sourceMappingURL=_index.scss.map */
@@ -0,0 +1,65 @@
1
+ ////
2
+ /// @group tools
3
+ ////
4
+
5
+ /// Wraps rebranded properties in the feature flag selector
6
+ ///
7
+ /// @example scss - Wrap a block of multiple properties
8
+ /// .foo {
9
+ /// border-width: 1px;
10
+ /// border-colour: #fff;
11
+ ///
12
+ /// @include _govuk-rebrand() {
13
+ /// border-width: 10px;
14
+ /// border-colour: #000;
15
+ /// }
16
+ /// }
17
+ ///
18
+ /// @example scss - Wrap a single property
19
+ /// .foo {
20
+ /// @include _govuk-rebrand("background-color", $from: #fff, $to: #000)
21
+ /// }
22
+ ///
23
+ ///
24
+ /// @param {String} $property - The name of the property being rebranded
25
+ /// @param {String} $from - The original value of the property
26
+ /// @param {String} $to - The rebranded value of the property
27
+ /// @throw if `$property` is set but `$from` or `$to` are missing
28
+ /// @access private
29
+ @mixin _govuk-rebrand($property: null, $from: null, $to: null) {
30
+ @if $property {
31
+ @if not $from {
32
+ @error "`_govuk-rebrand` needs the original value, `$from`";
33
+ }
34
+
35
+ @if not $to {
36
+ @error "`_govuk-rebrand` needs the rebranded value, `$to`";
37
+ }
38
+
39
+ #{$property}: #{$from};
40
+
41
+ @include _govuk-rebrand-wrapper {
42
+ #{$property}: #{$to};
43
+ }
44
+ } @else {
45
+ @include _govuk-rebrand-wrapper {
46
+ @content;
47
+ }
48
+ }
49
+ }
50
+
51
+ @mixin _govuk-rebrand-wrapper() {
52
+ $selector: "#{&}";
53
+
54
+ @if $selector == ".govuk-template" {
55
+ @at-root .govuk-template--rebranded {
56
+ @content;
57
+ }
58
+ } @else {
59
+ .govuk-template--rebranded & {
60
+ @content;
61
+ }
62
+ }
63
+ }
64
+
65
+ /*# sourceMappingURL=_rebrand.scss.map */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-govuk-formbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.1
4
+ version: 1.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive
@@ -186,6 +186,7 @@ files:
186
186
  - node_modules/govuk-frontend/dist/govuk/tools/_index.scss
187
187
  - node_modules/govuk-frontend/dist/govuk/tools/_px-to-em.scss
188
188
  - node_modules/govuk-frontend/dist/govuk/tools/_px-to-rem.scss
189
+ - node_modules/govuk-frontend/dist/govuk/tools/_rebrand.scss
189
190
  - node_modules/govuk-frontend/dist/govuk/utilities/_all.scss
190
191
  - node_modules/govuk-frontend/dist/govuk/utilities/_clearfix.scss
191
192
  - node_modules/govuk-frontend/dist/govuk/utilities/_index.scss