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

nested at-rules breaks at-rule merging #777

Closed
clshortfuse opened this issue Jul 22, 2019 · 1 comment · Fixed by #1933
Closed

nested at-rules breaks at-rule merging #777

clshortfuse opened this issue Jul 22, 2019 · 1 comment · Fixed by #1933
Assignees
Labels
bug cosmetic Doesn't affects CSS semantics

Comments

@clshortfuse
Copy link

clshortfuse commented Jul 22, 2019

I recently moved from node-sass 4.12.0 to (dart-)sass 1.22.7

Upon switching, I noticed that some at-rules end up being repeated. I've tracked down the issue where upon using a nested at-rule, it breaks subsequent rules.

My project that shows the issue is here: https://github.com/clshortfuse/materialdesignweb/blob/3964f7d72f2d6753d9691ed70c8b4fc60cb52dd7/components/layout/_spec.scss

I've a smaller version of the issue available here:

https://www.sassmeister.com/gist/a66eb997749a1c088dd290c30bfd0003

On a related sidenote, I actually had rewritten a good chunk of cssnano's merge-rules plugin to do this in post-processing, and it's been commited to master, but cssnano hasn't received a version bump yet.

https://github.com/cssnano/cssnano/pull/722/files

@nex3
Copy link
Contributor

nex3 commented Jul 22, 2019

For a minimal reproduction:

@media (a: b) {
  @media (orientation: portrait) {
    c {d: e}
  }
  
  f {g: h}
  i {j: k}
}

should produce

@media (a: b) and (orientation: portrait) {
  c {
    d: e;
  }
}
@media (a: b) {
  f {
    g: h;
  }

  i {
    j: k;
  }
}

but actually produces

@media (a: b) and (orientation: portrait) {
  c {
    d: e;
  }
}
@media (a: b) {
  f {
    g: h;
  }
}
@media (a: b) {
  i {
    j: k;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cosmetic Doesn't affects CSS semantics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants