Fix global styles for unbranded layout #1726
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 insettings.scss
. I think this behaviour is unavoidable, but luckily there is a workaround; we were only importing the settings to getgovuk-body-background-colour
, but the value of that is just#fffff
(white). We can set the value to white without needing to import any settings. If the GOV.UK Design System decides to go with an off-white body background colour in the future, that's also fine, the point of the unbranded template is not to look like GOV.UK, so we're not losing anything by hardcoding the value.