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

Problems with nested CSS in .css file imported from Scss #2322

Open
t-kinoshita opened this issue Aug 28, 2024 · 1 comment
Open

Problems with nested CSS in .css file imported from Scss #2322

t-kinoshita opened this issue Aug 28, 2024 · 1 comment
Assignees

Comments

@t-kinoshita
Copy link

Recently CSS has native nesting, and in importing CSS with combinations of multiple nesting and @media from Scss I found a problem.

(it might be labelled as wontfix, as Sass @import is going to be deprecated...)

Reproduction

// test.scss
@import './test2';
/* test2.css */
.foo{
  .bar{
    @media screen{
      color: red;
    }
  }
}
$ npx sass test.scss

Expected result

@media screen{
  .foo .bar{
    color: red;
  }
}

Actual result

@media screen {
  .bar {
    color: red;
  }
}

Environment

$ uname -a
Linux DESKTOP-BR1RAQF 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

$ node -v
v12.22.9 # very old; but in newer Node this problem reproduced too

$ npm --version
8.5.1

$ npx sass --version
1.77.8
@pamelalozano16
Copy link
Contributor

I tried reproducing the error and it compiled to the expected result:

$ npx sass test.scss
/* test2.css */
@media screen {
  .foo .bar {
    color: red;
  }
}

Environment:

$ npx sass --version
1.78.0 compiled with dart2js 3.5.2
$ node -v
v18.20.0
$ npm -v
8.19.4

Please update to the latest versions of Sass, Node.js, and npm, and let us know if the issue persists.

@nex3 nex3 added the needs info label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants