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

Dart sass #1661

Merged
merged 6 commits into from
Aug 12, 2024
Merged

Dart sass #1661

merged 6 commits into from
Aug 12, 2024

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Aug 12, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What

Migrate to dart sass from lib sass.

Relates to alphagov/govuk_publishing_components#4106

Note that this change relies upon a change in govuk-docker, in this PR: alphagov/govuk-docker#771

Why

All applications using govuk_publishing_components should be using dart sass, and some changes coming in that gem may cause errors if applications aren't using dart sass.

Visual changes

None.

Trello card: https://trello.com/c/gW2NW1sB/239-fix-sass-compilation-warnings

- Create `dartsass.builds` initializer and add all Sass files to be compiled. See https://github.com/rails/dartsass-rails#configuring-builds
- Create .keep
- Update manifest file to use /builds directory
- Ignore /builds
- Also, turn digests off in development
- was getting `undefined method assets` when trying to build transition in docker
- followed this advice to fix the problem: https://stackoverflow.com/questions/50984265/ruby-on-rails-console-undefined-method-assets
andysellick added a commit to alphagov/govuk-docker that referenced this pull request Aug 12, 2024
- change needed to support the switch to dart-sass for Sass compilation in alphagov/transition#1661
- relying upon glyphicons as part of bootstrap, but the Sass for that doesn't compile properly in dart-sass because it uses `url(font-path(path))`
- instead copy the font-face declaration from bootstrap into our code, overridding the original with this one, which fixes the icon paths and the icons
- see similar problem fixed in content-tagger: alphagov/content-tagger#1768
@andysellick andysellick merged commit 4f1bd43 into main Aug 12, 2024
10 checks passed
@andysellick andysellick deleted the dart-sass branch August 12, 2024 11:56
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.

2 participants