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

Sass error #7

Open
artola opened this issue Dec 6, 2021 · 0 comments
Open

Sass error #7

artola opened this issue Dec 6, 2021 · 0 comments

Comments

@artola
Copy link

artola commented Dec 6, 2021

When compiling with sass v1.44.0 (also some previous, e.g., v1.32.12) we get an error:

  Module build failed (from ../../node_modules/sass-loader/dist/cjs.js):
  SassError: Top-level selectors may not contain the parent selector "&".
      ╷
  179 │     &.#{get-formatted-namespace()}container {
      │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ╵
    ../../node_modules/spartan-grid/dist/spartan.scss 179:2                          -spartan-gutter-styles()
    ../../node_modules/spartan-grid/dist/spartan.scss 357:3                          grid-gutter()

It is necessary just to remove the & in line 179 to make it compatible, and there is no difference in the CSS outcome.

&.#{get-formatted-namespace()}container {

Note: for the record node-sass that we used before was not throwing on this error, but as that package is "deprecated", we need to move forward to the newest "sass" implementation.

Example in SassMeister:

https://www.sassmeister.com/gist/27f34260a80e3429758a7e7fb7179330?token=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&scope=gist,read:user

image

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

1 participant