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

Unexpected behaviour with @at-root #1236

Closed
KittyGiraudel opened this issue May 25, 2015 · 5 comments
Closed

Unexpected behaviour with @at-root #1236

KittyGiraudel opened this issue May 25, 2015 · 5 comments

Comments

@KittyGiraudel
Copy link

Bug found by Jaime Caballero: https://twitter.com/jaicab_/status/602583391515574273.

Test case

@mixin test {
  $selector-list: &;                 // (.a .b,)
  $selector: nth($selector-list, 1); // (.a .b)
  $first: nth($selector, 1);         // .a
  $second: nth($selector, 2);        // .b
  $add: 'dummy';

  @at-root #{$first} #{$add} #{$second} {
    @content;
  }
}


.a .b {
  @include test {
    color: red;
  }
}

Expected result

.a dummy .b {
  color: red;
}

Actual result (LibSass 3.2.4)

.a .b .a dummy .b {
  color: red;
}
@jaicab
Copy link

jaicab commented May 25, 2015

Thanks @hugogiraudel for setting up this issue!
It's interesting that when you add some actual text around it (like an html tag or something) it does work. Check out my original example on SassMeister.

@xzyfer
Copy link
Contributor

xzyfer commented May 27, 2015

I've assigned this to 3.3. A spec would be appreciated. Possibly related to #1210

@KittyGiraudel
Copy link
Author

There you have it.

@mgreter
Copy link
Contributor

mgreter commented May 30, 2015

This issue is also covered by my latest WIP branch, which seems to fix most if not all @at-root related bugs (ETA unknown, targeted 3.3): #1249

@mgreter mgreter self-assigned this May 30, 2015
@xzyfer
Copy link
Contributor

xzyfer commented May 31, 2015

Looking at this closer it's actually just an @at-root problem. The selector functions have nothing to do with.

This is a duplicate of #1210.

@xzyfer xzyfer closed this as completed May 31, 2015
mgreter added a commit to mgreter/libsass-spec that referenced this issue Mar 22, 2020
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

4 participants