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

Getting warnings from Sass #2411

Open
Tracked by #3574
joelanman opened this issue Jul 15, 2024 · 1 comment
Open
Tracked by #3574

Getting warnings from Sass #2411

joelanman opened this issue Jul 15, 2024 · 1 comment

Comments

@joelanman
Copy link
Contributor

joelanman commented Jul 15, 2024

Description of the issue

On startup the kit now has warnings from Sass:

DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

    ┌──> node_modules/govuk-prototype-kit/lib/assets/sass/manage-prototype.scss
35  │     padding-left: 0;
    │     ^^^^^^^^^^^^^^^ declaration
    ╵
    ┌──> node_modules/govuk-prototype-kit/node_modules/govuk-frontend/dist/govuk/vendor/_sass-mq.scss
229 │ ┌         @media #{$media-type + $media-query} {
230 │ │             @content;
231 │ │         }
    │ └─── nested rule
    ╵
    node_modules/govuk-prototype-kit/lib/assets/sass/manage-prototype.scss 35:3  root stylesheet

The warnings dont affect the kit running, but if you want to silence them, you can add an override to package.json as I've done here:

https://github.com/joelanman/govuk-prototype-kit-prototype/blob/main/package.json#L12-L14

After that you'll need to npm uninstall govuk-prototype-kit then npm install govuk-prototype-kit

As an aside, I wonder if its best to pin versions in the govuk prototype kit package.json so this sort of thing doesnt happen

Related GOV.UK Frontend issue here:

@romaricpascal
Copy link
Member

romaricpascal commented Jul 16, 2024

Hi @joelanman 👋🏻

That's a neat workaround. I've added this to the list of small stories our team might look at outside of the main stream of work currently prioritised. Your suggestion of pinning the versions sounds neat to avoid the situation arising in the future (maybe to tilde prefixed ones rather than set version numbers to enable patches).

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

No branches or pull requests

2 participants