Skip to content

Commit

Permalink
Fix global styles for unbranded layout
Browse files Browse the repository at this point in the history
I noticed that one of the text lines wasn't formatted correctly on the
password page, because it was missing the `govuk-body` class. Digging
deeper, it seems that we used to expect that the GOV.UK frontend global
styles would work for pages using the 'unbranded' stylesheet, but it
stopped in the rework for v13.

The issue is that we import the govuk-frontend settings in the unbranded
template, before we set the govuk-global-styles variable to true.
Previously this was fine because we were setting that variable strongly,
however in v13 we added the `!default` thingy [[1]], because we want
users to be able to override the value in `settings.scss`. I think this
behaviour is unavoidable, but luckily there is a workaround; we were
only importing the settings to get `govuk-body-background-colour`, so we
can import just the settings we need rather than the whole thing. It's a
bit hacky, but it should hopefully work for now.
  • Loading branch information
lfdebrux committed Oct 27, 2022
1 parent e759c6a commit d48d890
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/assets/sass/unbranded.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
//
// See https://govuk-prototype-kit.herokuapp.com/docs/templates/blank-unbranded

// Import settings first so we can override them before importing all of GOV.UK Frontend
// If you need to enable compatibility mode or the legacy palette, do that *before* this import.
@import "node_modules/govuk-frontend/govuk/settings/all";
// Import the body background colour
@import "node_modules/govuk-frontend/govuk/settings/colours-palette";
@import "node_modules/govuk-frontend/govuk/settings/colours-organisations";
@import "node_modules/govuk-frontend/govuk/settings/colours-applied";

// Override the default GOV.UK Frontend font stack
$govuk-font-family: "HelveticaNeue", "Helvetica Neue", "Arial", "Helvetica", sans-serif;
Expand Down

0 comments on commit d48d890

Please sign in to comment.