Skip to content

Commit ac884dd

Browse files
Merge pull request #1966 from nhsuk/port-released-v10
Port released v10.5.2 into v11
2 parents 077a694 + e72d22d commit ac884dd

30 files changed

Lines changed: 475 additions & 150 deletions

File tree

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,51 @@ We've changed the hover and active icon colour for the action link component so
559559

560560
This change was introduced in [pull request #1802: Change action link icon colour on hover and active](https://github.com/nhsuk/nhsuk-frontend/pull/1802).
561561

562+
## 10.5.2 - 8 June 2026
563+
564+
Note: This release was created from the `support/10.x` branch.
565+
566+
### :wastebasket: **Deprecated features**
567+
568+
#### Rename Sass mixins for font weights
569+
570+
We've renamed Sass mixins for font weights. You can still use the previous names but we'll remove them in a future breaking release.
571+
572+
If you use Sass and you've used the following Sass mixins:
573+
574+
- replace `nhsuk-typography-weight-normal` with `nhsuk-font-weight-normal`
575+
- replace `nhsuk-typography-weight-bold` with `nhsuk-font-weight-bold`
576+
577+
```patch
578+
.app-component {
579+
display: block;
580+
- @include nhsuk-typography-weight-bold;
581+
+ @include nhsuk-font-weight-bold;
582+
@include nhsuk-responsive-margin(4, "bottom");
583+
}
584+
```
585+
586+
The previous names are deprecated and will be removed in a future release.
587+
588+
This change was introduced in [pull request #1962: Add code and monospace font utilities](https://github.com/nhsuk/nhsuk-frontend/pull/1962).
589+
590+
### :wrench: **Fixes**
591+
592+
In [pull request #1962: Add code and monospace font utilities](https://github.com/nhsuk/nhsuk-frontend/pull/1962) we've added missing Sass mixins and HTML classes. You can now style codes and sequences (such as NHS numbers) by adding the `nhsuk-u-font-code` HTML class, or by including the Sass mixin for custom components:
593+
594+
```scss
595+
.app-component__element {
596+
@include nhsuk-font-code;
597+
}
598+
```
599+
600+
To render text with a monospace font you can add the `nhsuk-u-font-monospace` HTML class, or by including the corresponding `nhsuk-font-monospace` Sass mixin.
601+
602+
We've made fixes to NHS.UK frontend in the following pull requests:
603+
604+
- [#1964: Move details component link appearance to summary text](https://github.com/nhsuk/nhsuk-frontend/pull/1964)
605+
- [#1965: Make sure icons always use current text colour etc](https://github.com/nhsuk/nhsuk-frontend/pull/1965)
606+
562607
## 10.5.1 - 3 June 2026
563608

564609
Note: This release was created from the `support/10.x` branch.

packages/nhsuk-frontend-review/src/examples/typography.njk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@
115115

116116
<h2>Typography with components</h2>
117117

118-
<p class="nhsuk-u-font-weight-bold">This is a paragraph using nhsuk-u-font-weight-bold. Nam quis posuere nisl, eget vulputate eros. Duis non mollis mi. Aliquam pulvinar posuere elementum. Fusce tincidunt interdum mauris non pretium.</p>
118+
<p>An NHS number is a 10 digit number, like <span class="nhsuk-u-font-code nhsuk-u-nowrap">999 123 4567</span>, using <code>nhsuk-u-font-code</code> and <code>nhsuk-u-nowrap</code>.</p>
119+
120+
<p class="nhsuk-u-font-weight-bold">This is a paragraph using <code>nhsuk-u-font-weight-bold</code>. Nam quis posuere nisl, eget vulputate eros. Duis non mollis mi. Aliquam pulvinar posuere elementum. Fusce tincidunt interdum mauris non pretium.</p>
119121

120122
<h3>List (Unordered list)</h3>
121123

packages/nhsuk-frontend/src/nhsuk/components/action-link/_index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
fill: nhsuk-colour("green");
6868

6969
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
70-
fill: buttontext;
70+
fill: ButtonText;
7171
}
7272
}
7373
}
@@ -79,7 +79,7 @@
7979
fill: $nhsuk-reverse-text-colour;
8080

8181
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
82-
fill: buttontext;
82+
fill: ButtonText;
8383
}
8484
}
8585
}

packages/nhsuk-frontend/src/nhsuk/components/button/_index.scss

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,18 @@ $nhsuk-button-search-icon-size-large: 38px;
144144

145145
// Override high-contrast link colours to match buttons
146146
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
147-
color: buttontext;
147+
color: ButtonText;
148148

149149
&,
150150
&::before {
151-
border-color: buttonborder;
151+
border-color: ButtonBorder;
152+
}
153+
154+
&:not(:focus):not(:active):hover,
155+
&:not(:focus):not(:active):hover::before,
156+
&:not(:focus):not(:active):hover::after {
157+
border-color: Highlight;
158+
color: Highlight;
152159
}
153160
}
154161
}

packages/nhsuk-frontend/src/nhsuk/components/card/_index.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ $nhsuk-card-border-hover-colour: $nhsuk-secondary-border-colour;
226226
fill: $nhsuk-link-hover-colour;
227227

228228
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
229-
fill: linktext;
229+
fill: LinkText;
230230
}
231231
}
232232

@@ -243,7 +243,7 @@ $nhsuk-card-border-hover-colour: $nhsuk-secondary-border-colour;
243243
fill: $nhsuk-link-active-colour;
244244

245245
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
246-
fill: activetext;
246+
fill: ActiveText;
247247
}
248248
}
249249
}
@@ -539,7 +539,7 @@ $nhsuk-card-border-hover-colour: $nhsuk-secondary-border-colour;
539539
@include nhsuk-responsive-spacing(5, "right");
540540

541541
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
542-
fill: buttontext;
542+
fill: ButtonText;
543543
}
544544
}
545545
}

packages/nhsuk-frontend/src/nhsuk/components/code/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
.nhsuk-code__container,
3535
.nhsuk-code__content {
36-
font-family: $nhsuk-code-font;
36+
@include nhsuk-font-monospace;
3737
}
3838

3939
.nhsuk-code__container {

packages/nhsuk-frontend/src/nhsuk/components/contents-list/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
}
3333

3434
.nhsuk-contents-list__current {
35-
font-weight: $nhsuk-font-weight-bold;
35+
@include nhsuk-font-weight-bold;
3636
}
3737
}

packages/nhsuk-frontend/src/nhsuk/components/details/_index.scss

Lines changed: 92 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
5959

6060
.nhsuk-details__summary-text {
6161
display: block;
62-
font-weight: $nhsuk-font-weight-bold;
62+
@include nhsuk-font-weight-bold;
6363
@include nhsuk-responsive-margin(4, "bottom");
6464
}
6565
}
@@ -77,8 +77,11 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
7777
position: relative; // [2]
7878
width: fit-content; // [1]
7979
padding-left: nhsuk-px-to-rem(nhsuk-spacing(4));
80+
text-decoration: none;
8081
cursor: pointer;
81-
@include nhsuk-link-style-default;
82+
83+
@include nhsuk-link-style-focus;
84+
@include nhsuk-top-and-bottom;
8285

8386
&::-webkit-details-marker {
8487
display: none; // [4]
@@ -100,21 +103,60 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
100103
.nhsuk-details[open] > &::before {
101104
@include nhsuk-shape-arrow($direction: down, $base: 14px);
102105
}
106+
}
103107

104-
.nhsuk-details--reverse &:not(:focus),
105-
.nhsuk-details--reverse &:not(:focus):hover {
106-
color: $nhsuk-reverse-text-colour;
107-
}
108+
// Style the arrow and summary text to look like a link...
109+
.nhsuk-details__summary::before,
110+
.nhsuk-details__summary-text {
111+
color: $nhsuk-link-colour;
108112
}
109113

110114
// ...but only underline the text, not the arrow
111115
.nhsuk-details__summary-text {
112116
@include nhsuk-link-decoration; // [3]
117+
@include nhsuk-responsive-margin(3, "bottom");
113118
}
114119

115-
// Remove the underline when focussed to avoid duplicate borders
116-
.nhsuk-details__summary:focus .nhsuk-details__summary-text {
117-
text-decoration: none;
120+
.nhsuk-details__summary-text:only-child {
121+
margin-bottom: 0;
122+
}
123+
124+
.nhsuk-details__summary:hover {
125+
&::before,
126+
& .nhsuk-details__summary-text {
127+
color: $nhsuk-link-hover-colour;
128+
}
129+
130+
& .nhsuk-details__summary-text {
131+
@include nhsuk-link-hover-decoration;
132+
}
133+
}
134+
135+
.nhsuk-details__summary:active {
136+
&::before,
137+
& .nhsuk-details__summary-text {
138+
color: $nhsuk-link-active-colour;
139+
}
140+
}
141+
142+
.nhsuk-details__summary:focus {
143+
&::before,
144+
& .nhsuk-details__summary-text {
145+
color: $nhsuk-focus-text-colour;
146+
}
147+
148+
// Remove the underline when focussed to avoid duplicate borders
149+
& .nhsuk-details__summary-text {
150+
text-decoration: none;
151+
}
152+
}
153+
154+
.nhsuk-details--reverse .nhsuk-details__summary:not(:focus),
155+
.nhsuk-details--reverse .nhsuk-details__summary:not(:focus):hover {
156+
&::before,
157+
& .nhsuk-details__summary-text {
158+
color: $nhsuk-reverse-text-colour;
159+
}
118160
}
119161

120162
.nhsuk-details__text {
@@ -128,6 +170,32 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
128170
border-left-color: $nhsuk-reverse-border-colour;
129171
}
130172
}
173+
174+
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
175+
.nhsuk-details__summary,
176+
.nhsuk-details__summary:hover {
177+
&::before,
178+
& .nhsuk-details__summary-text {
179+
color: LinkText;
180+
}
181+
}
182+
183+
.nhsuk-details__summary:active {
184+
&::before,
185+
& .nhsuk-details__summary-text {
186+
color: ActiveText;
187+
}
188+
}
189+
190+
.nhsuk-details__summary:focus,
191+
.nhsuk-details--reverse .nhsuk-details__summary:not(:focus),
192+
.nhsuk-details--reverse .nhsuk-details__summary:not(:focus):hover {
193+
&::before,
194+
& .nhsuk-details__summary-text {
195+
color: LinkText;
196+
}
197+
}
198+
}
131199
}
132200

133201
// Expander variant
@@ -182,8 +250,7 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
182250

183251
.nhsuk-details__summary-text {
184252
display: block;
185-
font-weight: $nhsuk-font-weight-bold;
186-
@include nhsuk-font-size(26);
253+
@include nhsuk-font(26, $weight: bold);
187254
@include nhsuk-responsive-margin(4, "bottom");
188255
}
189256
}
@@ -209,27 +276,18 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
209276
}
210277

211278
.nhsuk-details__summary:focus {
279+
outline: none;
212280
box-shadow: none;
213281
}
214282

215283
.nhsuk-details__summary-text {
216284
display: inline-block;
217-
218285
position: relative;
219-
220286
padding: nhsuk-spacing(1);
221287
padding-left: $nhsuk-expander-icon-size + nhsuk-spacing(2);
222-
223-
color: $nhsuk-link-colour;
224-
225288
cursor: pointer;
226289
}
227290

228-
.nhsuk-details__summary:hover .nhsuk-details__summary-text {
229-
color: $nhsuk-link-hover-colour;
230-
@include nhsuk-link-hover-decoration;
231-
}
232-
233291
.nhsuk-details__summary:focus .nhsuk-details__summary-text {
234292
@include nhsuk-focused-text;
235293
}
@@ -250,7 +308,7 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
250308
"M13.5 1a12.5 12.5 0 1 1 0 25 12.5 12.5 0 0 1 0-25Zm0 6c-.8 0-1.5.7-1.5 1.5V12H8.5c-.8 0-1.4.6-1.5 1.4v.1c0 .8.7 1.5 1.5 1.5H12v3.5c0 .8.6 1.4 1.4 1.5h.1c.8 0 1.5-.7 1.5-1.5V15h3.5c.8 0 1.4-.6 1.5-1.4v-.1c0-.8-.7-1.5-1.5-1.5H15V8.5c0-.8-.6-1.4-1.4-1.5Z"
251309
); // Plus icon
252310

253-
background-color: currentcolor;
311+
background-color: ButtonText;
254312
}
255313

256314
&[open] {
@@ -272,8 +330,10 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
272330

273331
.nhsuk-details__summary-text::before {
274332
top: calc(50% - nhsuk-px-to-rem(math.div($nhsuk-expander-icon-size, 2)));
333+
275334
width: nhsuk-px-to-rem($nhsuk-expander-icon-size);
276335
height: nhsuk-px-to-rem($nhsuk-expander-icon-size);
336+
277337
clip-path: shape(
278338
from 50% 3.7%,
279339
arc by 0% 92.6% of 46.3% 46.3% large cw,
@@ -301,6 +361,10 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
301361
curve by -5.19% -5.56% with 0% -2.96% / -2.22% -5.19%,
302362
close
303363
); // Plus icon, scalable
364+
365+
background-color: currentcolor;
366+
367+
forced-color-adjust: none;
304368
}
305369

306370
&[open] .nhsuk-details__summary-text::before {
@@ -318,6 +382,12 @@ $nhsuk-expander-icon-size: 27px; // 19px font size + 4px summary text padding
318382
); // Minus icon, scalable
319383
}
320384
}
385+
386+
@media screen and (forced-colors: active), (-ms-high-contrast: active) {
387+
.nhsuk-details__summary:not(:focus):not(:hover):not(:active) .nhsuk-details__summary-text::before {
388+
background-color: ButtonText;
389+
}
390+
}
321391
}
322392
}
323393

packages/nhsuk-frontend/src/nhsuk/components/error-summary/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
}
5757

5858
.nhsuk-error-summary__list a {
59-
@include nhsuk-typography-weight-bold;
59+
@include nhsuk-font-weight-bold;
6060
@include nhsuk-link-style-error;
6161
}
6262
}

packages/nhsuk-frontend/src/nhsuk/components/fieldset/_index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
.nhsuk-fieldset__legend--l,
5151
.nhsuk-fieldset__legend--m {
5252
margin-bottom: nhsuk-spacing(3);
53-
@include nhsuk-typography-weight-bold;
53+
@include nhsuk-font-weight-bold;
5454
}
5555

5656
.nhsuk-fieldset__legend--xl {
@@ -66,7 +66,7 @@
6666
}
6767

6868
.nhsuk-fieldset__legend--s {
69-
@include nhsuk-typography-weight-bold;
69+
@include nhsuk-font-weight-bold;
7070
}
7171

7272
// When the legend contains an H1, we want the H1 to inherit all styles from

0 commit comments

Comments
 (0)