SpartanGrid
SpartanGrid copied to clipboard
Sass error
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.
https://github.com/SimonHarte/SpartanGrid/blob/d90f64c93196133b369fed0cdd5c9e0b1d5a9390/dist/spartan.scss#L179
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
