From fdaf57b5d4cd78787175fd9613b16eb311def8a2 Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Tue, 16 Nov 2021 13:03:01 +0000 Subject: [PATCH 1/2] Remove default font styles from cookie banner Sass Removes the default font styles (setting the font and font-size) from the cookie banner Sass. This work was prompted by https://github.com/alphagov/govuk-design-system/issues/1886 With the default font styles present, it's very difficult to spot if you forget to add the relevant `govuk-body` styles to any `html` you pass into the component. We had missed this ourselves when we added the cookie banner to the design system. This change should only affect users who are passing `html` to the cookie banner. --- src/govuk/components/cookie-banner/_index.scss | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/govuk/components/cookie-banner/_index.scss b/src/govuk/components/cookie-banner/_index.scss index f09287e487..95b84b1539 100644 --- a/src/govuk/components/cookie-banner/_index.scss +++ b/src/govuk/components/cookie-banner/_index.scss @@ -4,8 +4,6 @@ $border-bottom-width: govuk-spacing(2); .govuk-cookie-banner { - @include govuk-font($size: 19); - padding-top: govuk-spacing(4); // The component does not set bottom spacing. // The bottom spacing should be created by the items inside the component. From 66ea6e3d1e48089d623362bf1a6a86780e48731a Mon Sep 17 00:00:00 2001 From: Vanita Barrett Date: Tue, 16 Nov 2021 15:32:13 +0000 Subject: [PATCH 2/2] Add to Changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4d29ae20c..17fea72fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -128,6 +128,14 @@ Replace any use of this class with the `govuk-tag--grey` class. This change was introduced in [pull request #2417: Remove deprecated `govuk-tag--inactive class`](https://github.com/alphagov/govuk-frontend/pull/2417). +#### Style any custom HTML in your cookie banner + +We've removed the default font styles from the cookie banner Sass. This change makes it more obvious when classes and styles have not been added to any custom HTML. + +If you're passing custom HTML into the cookie banner component (for example, using the `html` Nunjucks parameter), you must make sure you're applying the appropriate classes and styles to that HTML, such as adding the `govuk-body` class to any paragraph tags. You must do this to prevent your cookie banner displaying with unstyled text. + +This change was introduced in [pull request #2432: Remove default font styles from cookie banner Sass](https://github.com/alphagov/govuk-frontend/pull/2432). + ### Optional changes We've recently made some other changes to GOV.UK Frontend. While these are not breaking changes, implementing them will make your service work better.