Skip to content

Commit 15388fb

Browse files
Merge branch 'main' into header-breaking-changes
2 parents d136512 + 8df1221 commit 15388fb

File tree

10 files changed

+171
-15
lines changed

10 files changed

+171
-15
lines changed

CHANGELOG.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
## Unreleased
44

5+
:wrench: **Fixes**
6+
7+
We've made fixes to NHS.UK frontend in the following pull requests:
8+
9+
- [#1301: Support webpack `sass-loader` pkg: scheme with nested paths](https://github.com/nhsuk/nhsuk-frontend/pull/1307)
10+
11+
## 9.5.2 - 14 May 2025
12+
13+
:wrench: **Fixes**
14+
15+
We've made fixes to NHS.UK frontend in the following pull requests:
16+
17+
- [#1301: Fix legacy Sass import path for inset text component](https://github.com/nhsuk/nhsuk-frontend/pull/1301)
18+
19+
## 9.5.1 - 14 May 2025
20+
21+
:wrench: **Fixes**
22+
23+
We've made fixes to NHS.UK frontend in the following pull requests:
24+
25+
- [#1300: Fix deprecation warnings for settings and tools `/all` paths](https://github.com/nhsuk/nhsuk-frontend/pull/1300)
26+
27+
## 9.5.0 - 13 May 2025
28+
529
:new: **New features**
630

731
#### Updated header
@@ -149,7 +173,7 @@ If you are overriding any settings prefixed with `$mq-` in your application you
149173

150174
#### Replace Sass mixins for grids
151175

152-
If you're using the `govuk-grid-column()` Sass mixin to create custom grid classes, you must replace it with the `nhsuk-grid-column()` mixin and remove the `$class` parameter.
176+
If you're using the `govuk-grid-column()` Sass mixin to create custom grid classes, you must replace it with the `nhsuk-grid-column()` mixin and set the `$class` parameter to `false`.
153177

154178
Before:
155179

@@ -165,7 +189,7 @@ After:
165189

166190
```scss
167191
.app-grid-column-one-quarter-at-desktop {
168-
@include nhsuk-grid-column(one-quarter, $at: desktop);
192+
@include nhsuk-grid-column(one-quarter, $at: desktop, $class: false);
169193
}
170194
```
171195

@@ -177,11 +201,23 @@ If you're using the `grid-width()` Sass mixin, you must replace it with the `nhs
177201

178202
If you're using the `govuk-main-wrapper()`, `govuk-main-wrapper--l()` or `govuk-main-wrapper--s()` Sass mixins, you must replace them with the `.nhsuk-main-wrapper`, `.nhsuk-main-wrapper--l` and `.nhsuk-main-wrapper--s` classes in your HTML.
179203

180-
#### Replace Sass mixin `nhsuk-typography-responsive` with `nhsuk-font-size`
204+
#### Replace Sass mixin `nhsuk-typography-responsive()` with `nhsuk-font-size()`
205+
206+
We've renamed the Sass mixin `nhsuk-typography-responsive()` to `nhsuk-font-size()` and have deprecated `nhsuk-typography-responsive()`. This better communicates its intended purpose and aligns with `nhsuk-font()` parameters.
207+
208+
Before:
209+
210+
```scss
211+
@include nhsuk-typography-responsive(26, $override-line-height: 1.2);
212+
```
181213

182-
We've renamed the Sass mixin `nhsuk-typography-responsive` to `nhsuk-font-size` and have deprecated `nhsuk-typography-responsive` to better communicate its intended use.
214+
After:
215+
216+
```scss
217+
@include nhsuk-font-size(26, $line-height: 1.2);
218+
```
183219

184-
You can still use `nhsuk-typography-responsive`, but we'll remove it in a future breaking release.
220+
You can still use `nhsuk-typography-responsive()`, but we'll remove it in a future breaking release.
185221

186222
#### Updated Sass mixin, function and variable namespace
187223

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nhsuk-frontend",
3-
"version": "9.4.1",
3+
"version": "9.5.2",
44
"description": "NHS.UK frontend contains the code you need to start building user interfaces for NHS websites and services.",
55
"engines": {
66
"node": "^20.9.0 || ^22.11.0"
@@ -15,11 +15,10 @@
1515
},
1616
"./*": "./*",
1717
"./packages/*": {
18-
"sass": "./packages/*.scss",
18+
"sass": "./packages/*",
1919
"default": "./packages/*.js"
2020
},
2121
"./packages/*.js": "./packages/*.js",
22-
"./packages/*.scss": "./packages/*.scss",
2322
"./package.json": "./package.json"
2423
},
2524
"main": "packages/index.js",
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { compileStringAsync } from 'sass-embedded'
2+
3+
describe('Components', () => {
4+
describe('importing using index file', () => {
5+
it('forwards all components', async () => {
6+
const sass = `
7+
@forward "components";
8+
`
9+
10+
const results = compileStringAsync(sass, {
11+
loadPaths: ['packages']
12+
})
13+
14+
await expect(results).resolves.not.toThrow()
15+
})
16+
})
17+
18+
describe('importing using legacy paths', () => {
19+
it('forwards all components', async () => {
20+
const sass = `
21+
@forward "components/action-link/action-link";
22+
@forward "components/back-link/back-link";
23+
@forward "components/breadcrumb/breadcrumb";
24+
@forward "components/button/button";
25+
@forward "components/card/card";
26+
@forward "components/contents-list/contents-list";
27+
@forward "components/date-input/date-input";
28+
@forward "components/details/details";
29+
@forward "components/do-dont-list/do-dont-list";
30+
@forward "components/error-message/error-message";
31+
@forward "components/error-summary/error-summary";
32+
@forward "components/fieldset/fieldset";
33+
@forward "components/footer/footer";
34+
@forward "components/header/header";
35+
@forward "components/header/header-organisation";
36+
@forward "components/header/header-service";
37+
@forward "components/header/header-transactional";
38+
@forward "components/header/header-white";
39+
@forward "components/hero/hero";
40+
@forward "components/hint/hint";
41+
@forward "components/images/images";
42+
@forward "components/input/input";
43+
@forward "components/inset-text/inset-text";
44+
@forward "components/label/label";
45+
@forward "components/pagination/pagination";
46+
@forward "components/panel/panel";
47+
@forward "components/checkboxes/checkboxes";
48+
@forward "components/radios/radios";
49+
@forward "components/select/select";
50+
@forward "components/skip-link/skip-link";
51+
@forward "components/summary-list/summary-list";
52+
@forward "components/tables/tables";
53+
@forward "components/tag/tag";
54+
@forward "components/task-list/task-list";
55+
@forward "components/textarea/textarea";
56+
@forward "components/warning-callout/warning-callout";
57+
@forward "components/character-count/character-count";
58+
@forward "components/tabs/tabs";
59+
`
60+
61+
const results = compileStringAsync(sass, {
62+
loadPaths: ['packages']
63+
})
64+
65+
await expect(results).resolves.not.toThrow()
66+
})
67+
})
68+
})

packages/components/skip-link/macro-options.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "href",
1010
"type": "string",
1111
"required": false,
12-
"description": "The value of the skip links `href` attribute. Defaults to `\"#maincontent\"` if you do not provide a value."
12+
"description": "The value of the skip link's `href` attribute. Defaults to `\"#maincontent\"` if you do not provide a value."
1313
},
1414
{
1515
"name": "classes",

packages/core/core.unit.test.mjs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { compileStringAsync, sassNull } from 'sass-embedded'
2+
3+
describe('Core', () => {
4+
/** @type {Logger} */
5+
let logger = {}
6+
7+
beforeEach(() => {
8+
// Create a mock warn function that we can use to override the native @warn
9+
// function, that we can make assertions about post-render.
10+
logger.warn = jest.fn().mockReturnValue(sassNull)
11+
})
12+
13+
describe('importing using "all" files', () => {
14+
it('outputs a warning when importing the core "all" file', async () => {
15+
const sass = `
16+
@forward "core/all";
17+
`
18+
19+
await compileStringAsync(sass, {
20+
loadPaths: ['packages'],
21+
logger
22+
})
23+
24+
expect(logger.warn).toHaveBeenCalledWith(
25+
`Importing using 'core/all' is deprecated. Update your import statement to import 'core'. To silence this warning, update $nhsuk-suppressed-warnings with key: "import-using-all"`,
26+
expect.anything()
27+
)
28+
})
29+
30+
it('outputs a warning for each layer that has an "all" file', async () => {
31+
const sass = `
32+
@forward "core/settings/all";
33+
@forward "core/tools/all";
34+
`
35+
36+
await compileStringAsync(sass, {
37+
loadPaths: ['packages'],
38+
logger
39+
})
40+
41+
for (const layer of ['settings', 'tools']) {
42+
expect(logger.warn).toHaveBeenCalledWith(
43+
`Importing using 'core/${layer}/all' is deprecated. Update your import statement to import 'core/${layer}'. To silence this warning, update $nhsuk-suppressed-warnings with key: "import-using-all"`,
44+
expect.anything()
45+
)
46+
}
47+
})
48+
})
49+
})
50+
51+
/**
52+
* @import { Logger } from 'sass-embedded'
53+
*/

packages/core/settings/_all.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use "settings/warnings" as *;
1+
@use "warnings" as *;
22
@forward ".";
33

44
@include nhsuk-warning(

packages/core/styles/_lists.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@
6666
%nhsuk-list + .nhsuk-heading-s {
6767
padding-top: nhsuk-spacing(1);
6868

69-
@include mq($from: tablet) {
69+
@include nhsuk-media-query($from: tablet) {
7070
padding-top: nhsuk-spacing(2);
7171
}
7272
}
7373

74-
@include mq($media-type: print) {
74+
@include nhsuk-media-query($media-type: print) {
7575
%nhsuk-list + h2,
7676
%nhsuk-list + h3,
7777
%nhsuk-list + h4,

packages/core/tools/_all.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use "settings/warnings" as *;
1+
@use "../settings/warnings" as *;
22
@forward ".";
33

44
@include nhsuk-warning(

0 commit comments

Comments
 (0)