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

docs: review all production guidance #1252

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

colinrotherham
Copy link
Contributor

@colinrotherham colinrotherham commented Mar 7, 2025

Various changes (lots of fixes) for the Sass module breaking release

Documentation has largely been updated using:
https://frontend.design-system.service.gov.uk


4.0.0 (Breaking release)

Support for Sass modules

In this release we’ve updated our Sass files to use the Sass module system.

To prevent breaking changes, you should update to Dart Sass from older compilers:

For Ruby on Rails users, see the dartsass-rails or dartsass-sprockets gem for asset pipeline compatibiliity.

@colinrotherham colinrotherham added the preview:request Deploy PR to a preview url label Mar 7, 2025
Copy link

github-actions bot commented Mar 7, 2025

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-upgrade-sass-modules.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

@github-actions github-actions bot added preview:active and removed preview:request Deploy PR to a preview url labels Mar 7, 2025
$moj-assets-path: "/application/assets/";

@import "@ministryofjustice/frontend/moj/all";
@forward "node_modules/@ministryofjustice/frontend/moj/all";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth using the @forward.... with here and retaining the assets path bit? I know its not strictly necessary but it makes it super obvious to someone how to set their own assets path without having to read the specific css page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've adapted it a bit and linked to the specific CSS page for more info

$moj-fonts-path: "/fonts/";

@import "@ministryofjustice/frontend/moj/all";
@forward "node_modules/@ministryofjustice/frontend/moj/components/button-menu/button-menu";
```

## Importing JavaScript
Copy link
Contributor

Choose a reason for hiding this comment

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

It won't let me comment on the line itself as it's not a change, but the link below this 'setting up javascript' - we've changed the title of the page (to Importing MOJ Jrontend Javascript IIRC)

Copy link

github-actions bot commented Mar 7, 2025

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-upgrade-sass-modules.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Base automatically changed from fix-code-blocks to main March 7, 2025 15:42
Copy link

github-actions bot commented Mar 7, 2025

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-upgrade-sass-modules.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

github-actions bot commented Mar 7, 2025

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-upgrade-sass-modules.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj

Copy link

github-actions bot commented Mar 7, 2025

🚀 Deployed to preview environment! If this is the first deploy, you may have to wait a few minutes for your preview site to be ready on the following URL:

https://moj-frontend-upgrade-sass-modules.apps.live.cloud-platform.service.justice.gov.uk

Username: preview, Password: moj


Example 1:
3. Import the files before the closing `</body>` tag of your page template, then run the `initAll` functions to initialise all the components. For example:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we say to put them at the bottom of the body element? I thought that was an anti-pattern nowadays as it prevents the preload scanner/parser from discovering the scripts early and script type="module" is defer by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants