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

Design system sass import broken in Rails apps #927

Open
chrispymm opened this issue Nov 15, 2024 · 0 comments · May be fixed by #928
Open

Design system sass import broken in Rails apps #927

chrispymm opened this issue Nov 15, 2024 · 0 comments · May be fixed by #928
Labels
bug A task that fixes something that isn't working

Comments

@chrispymm
Copy link
Contributor

all.sccs in our package contains an import with the path @import node_modules/govuk-frontend/dist/govuk/base

This path seems to be causing some users issues when including it into their projects, and they cannot build the design system css.

This issues seems to primarily affect rails projects:

rails/cssbundling-rails#101
rails/cssbundling-rails@9075819

cssbundling rails includes node_modules in the load path automatically, so having it in the import path in the sass file causes it to fail.

The recommendation from govuk, is to use the full path for imports (https://frontend.design-system.service.gov.uk/import-css/#import-specific-parts-using-sass)

Fixing this for rails projects, could cause issues for others...

@chrispymm chrispymm added the bug A task that fixes something that isn't working label Nov 15, 2024
chrispymm added a commit that referenced this issue Nov 15, 2024
This allows us to remove the node modules prefix from the govuk scss
import in all.scss. Which would resolve loading issues for users.

BREAKING CHANGE: This PR changes the loadpath for govuk frontend.  You
will now need to ensure your project SASS configuration includes
node_modules within its loadpaths in order to compile, however this is
often default behaviour in many build tools.

fix #927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A task that fixes something that isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant