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

@extend ignores @mixin #2959

Closed
GottZ opened this issue Aug 6, 2019 · 3 comments
Closed

@extend ignores @mixin #2959

GottZ opened this issue Aug 6, 2019 · 3 comments

Comments

@GottZ
Copy link

GottZ commented Aug 6, 2019

input.scss

%color {
  color: blue;
}

@mixin getOverridedSelector {
  &#{&} {
    @content;
  }
}

.foo {
  @include getOverridedSelector {
    @extend %color;
  }
}

.bar {
  @include getOverridedSelector {
    color: red;
  }
}

Actual results

libsass 3.6.0
Ruby Sass 3.7.4
as well as on codepen (probably libsass)

.foo {
  color: blue;
}

.bar.bar {
  color: red;
}

Expected result

dart sass 1.22.6-1 (Archlinux AUR)

.foo.foo {
  color: blue;
}

.bar.bar {
  color: red;
}

source that found this problem: https://stackoverflow.com/questions/57376896

@mgreter
Copy link
Contributor

mgreter commented Aug 6, 2019

@nex3 is this intentional or a regression in dart-sass?
Previous version of ruby sass had the same output as libsass.

@nex3
Copy link
Contributor

nex3 commented Aug 6, 2019

Dart Sass is correct here. The Ruby Sass and LibSass behavior violates the second law of extend, which says that the specificity of the generated selector (.foo, specificity 10) should be greater than or equal to the specificity of the extender (.foo.foo, specificity 20).

@mgreter
Copy link
Contributor

mgreter commented Oct 5, 2019

This seems to have been fixed on latest master.

@mgreter mgreter closed this as completed Oct 5, 2019
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