Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sass error #763

Merged
merged 3 commits into from
Jun 6, 2019
Merged

Fix sass error #763

merged 3 commits into from
Jun 6, 2019

Conversation

36degrees
Copy link
Contributor

The Prototype Kit is currently throwing a Sass error when trying to compile the unbranded stylesheet.

[10:36:10] Starting 'sass'...
Error in plugin "sass"
Message:
    app/assets/sass/unbranded.scss
Error: Undefined variable: "$govuk-body-background-colour".
        on line 7 of app/assets/sass/unbranded.scss
>> $govuk-canvas-background-colour: $govuk-body-background-colour;

   ---------------------------------^

[10:36:11] Finished 'sass' after 624 ms

In d901c7f we removed an import of govuk-frontend/settings/all because it caused issues for users overriding settings that relied on each other.

However, this broke the unbranded stylesheet as it refers to $govuk-body-background-colour which was then undefined.

Importing only the colour palette and applied colour settings solves this problem. We also document the fact that if a user (for whatever reason) wants to enable compatibility mode or use the legacy palette then they should do that before the import statements.

This also adds a test which compiles all Sass files in assets/sass, surfacing any compilation errors, which would have caught this.

This test currently fails because there is a compilation error in the unbranded stylesheet.
In d901c7f we removed an import of govuk-frontend/settings/all because it caused issues for users overriding settings that relied on each other.

However, this broke the unbranded stylesheet as it refers to `$govuk-body-background-colour` which was then undefined.

Importing only the colour palette and applied colour settings solves this problem. We also document the fact that if a user (for whatever reason) wants to enable compatibility mode or use the legacy palette then they should do that before the import statements.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-prototype-kit-pr-763 June 6, 2019 09:37 Inactive
@36degrees
Copy link
Contributor Author

#295 seems relevant here as we (I!) missed this error during development.

@NickColley
Copy link
Contributor

NickColley commented Jun 6, 2019

#295 seems relevant here as we (I!) missed this error during development.

Definitely we since I missed this too 🤦‍♂

Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a CHANGELOG entry

@36degrees 36degrees merged commit 9870b91 into master Jun 6, 2019
@36degrees 36degrees deleted the fix-sass-error branch June 6, 2019 10:01
@36degrees 36degrees mentioned this pull request Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants