Skip to content

Implement extend for wrapped selectors #1831

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

Merged
merged 2 commits into from
Jan 9, 2016

Conversation

mgreter
Copy link
Contributor

@mgreter mgreter commented Jan 7, 2016

Fixes #1797

A more complete spec test which has some logic I don't yet understand:

%not {
  color: red;
}
.not {
  @extend %not;
}
div:has(%not) {
  color: black;
}

bar {
  span:not(%not) {
    color: black;
  }
  span:not(&.foo) {
    color: black;
  }
  span:not(&%not) {
    color: black;
  }
}

Ruby sass result:

.not {
  color: red; }

div:has(.not) {
  color: black; }

bar span:not(.not) {
  color: black; }
span:not(bar.foo) {
  color: black; }
span:not(bar.not) {
  color: black; }

Libsass output with this PR:

.not {
  color: red; }

div:has(.not) {
  color: black; }

bar span:not(.not) {
  color: black; }

bar span:not(bar.foo) {
  color: black; }

bar span:not(bar.not) {
  color: black; }

It seems to follow the logic of this sample:

foo {
  span:not & {
    color: black;
  }
}

Which yields in both:

span:not bar {
  color: black; }

@mgreter mgreter self-assigned this Jan 7, 2016
@mgreter mgreter added this to the 3.3.3 milestone Jan 7, 2016
@mgreter mgreter force-pushed the feature/extend-wrapped-selectors branch from 211c52d to ea3158a Compare January 9, 2016 06:41
mgreter added a commit that referenced this pull request Jan 9, 2016
@mgreter mgreter merged commit dd5b97b into sass:master Jan 9, 2016
@xzyfer
Copy link
Contributor

xzyfer commented Jan 12, 2016

Spec added and activated in sass/sass-spec#690

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

Successfully merging this pull request may close these issues.

2 participants