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

Comments with interpolation output nested selectors #1996

Closed
Cleecanth opened this issue Apr 14, 2016 · 1 comment · Fixed by #1999
Closed

Comments with interpolation output nested selectors #1996

Cleecanth opened this issue Apr 14, 2016 · 1 comment · Fixed by #1999

Comments

@Cleecanth
Copy link

This is kind of hard to explain so I'll just put the code here and explain after.

$foo: "bar";

%class //#{$foo}
{
  &_baz {
    color: red;
  }
}

Ruby Sass outputs nothing (as expected).

Libsass outputs this:

_baz {
  color: red;
}

Sassmeister Link

Removing the interpolation in the comment fixes the issue.

I found a block of code in an old project that uses this hacky technique to switch between a silent class plus a regular class or just a silent class (by changing the // to a , . via a mixin).

It's a terrible technique and will definitely be changed, but its output is at least an interesting inconsistency between the two versions of Sass.

Worth fixing? Not sure, but it may point to a deeper issue.

@mgreter mgreter added this to the 3.3.5 milestone Apr 14, 2016
@mgreter mgreter self-assigned this Apr 14, 2016
@mgreter
Copy link
Contributor

mgreter commented Apr 14, 2016

Thanks for your report.
We didn't anticipate this edge case in selector schema evaluation.
Check out 41ca027 and you may see why it failed ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants