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

Remove unneeded settings import #752

Merged
merged 2 commits into from
May 28, 2019
Merged

Remove unneeded settings import #752

merged 2 commits into from
May 28, 2019

Conversation

36degrees
Copy link
Contributor

As all the settings are !default, the expected way to override settings is to define them before doing the import.

Importing the settings generally works, because we just end up redefining them before they get used. However, it does break some things – specifically, where settings rely on each other (such as the legacy mode settings, or $govuk-assets-path which is relied on by $govuk-images-path and $govuk-fonts-path).

This doesn't work correctly because e.g. $govuk-images-path gets defined before $govuk-assets-path gets overridden, which means it uses the old assets path.

This caught out a user who was using this as a template, and was overriding $govuk-assets-path but not seeing the expected changes represented in $govuk-images-path.

As all the settings are `!default`, the expected way to override settings is to define them before doing the import.

Importing the settings _generally_ works, because we just end up redefining them before they get used. However, it does break some things – specifically, where settings rely on each other (such as the legacy mode settings, or $govuk-assets-path which is relied on by $govuk-images-path and $govuk-fonts-path).

This doesn't work correctly because e.g. $govuk-images-path gets defined before $govuk-assets-path gets overridden, which means it uses the _old_ assets path.

This caught out a user who was using this as a template, and was overriding $govuk-assets-path but not seeing the expected changes represented in $govuk-images-path.
@36degrees
Copy link
Contributor Author

@NickColley just wanted to check if you're happy with this change, as I think you added this line originally?

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.

Not entirely sure why I did this, so if it doesnt blow up seems legit to me.

@36degrees 36degrees merged commit d14d1a0 into master May 28, 2019
@36degrees 36degrees deleted the remove-confusing-import branch May 28, 2019 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants