Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Invalid :not selector generated with @extend #2139

Closed
xzyfer opened this issue Aug 4, 2016 · 5 comments
Closed

Invalid :not selector generated with @extend #2139

xzyfer opened this issue Aug 4, 2016 · 5 comments

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Aug 4, 2016

Originally reported by @dreyks in sass/sassc#180. Possibly a duplicate of #2055.

 .base-class {
   color: #FFF;
 }

 .parent-class {
   .child-class {
     @extend .base-class;
     border: '1px';
   }
 }

 *:not(.base-class) {
   display: none;
 }

LibSass 3.3.6 (c6685d7)

.base-class, .parent-class .child-class {
  color: #FFF; }

.parent-class .child-class {
  border: '1px'; }

*:not(.base-class):not(.parent-class .child-class) {
  display: none; }

Sass 3.4.21

.base-class, .parent-class .child-class {
  color: #FFF; }

.parent-class .child-class {
  border: '1px'; }

*:not(.base-class) {
  display: none; }
sassc: 3.3.3-3-ge054
libsass: 3.3.6-90-gc6685
sass2scss: 1.0.6

Spec added sass/sass-spec#888

@xzyfer xzyfer added this to the 3.4.1 milestone Aug 4, 2016
xzyfer added a commit to xzyfer/sass-spec that referenced this issue Aug 4, 2016
@s-yadav
Copy link

s-yadav commented Aug 23, 2016

Got into same issue while upgrading from sass-rails to sassc-rails

@darklow
Copy link

darklow commented Oct 8, 2016

As a workaround I found that using attribute selector still works. Not perfect, but better than nothing.

/* Instead of */
:not(.thing) {
    @extend .thing;
    background: blue;
}

/* You can write: */
:not([class*="thing"]) {
    @extend .thing;
    background: blue;
}

@cmaart
Copy link

cmaart commented Jan 17, 2017

Can confirm issue occurring for:

$ node-sass --version
node-sass       4.3.0   (Wrapper)       [JavaScript]
libsass         3.4.3   (Sass Compiler) [C/C++]

@xzyfer
Copy link
Contributor Author

xzyfer commented Jan 17, 2017

Another example in dlmanning/gulp-sass#583

@mgreter
Copy link
Contributor

mgreter commented Jan 17, 2017

Closing as duplicate of #2055. I'm aware that extending wrapped selectors, :not is only one example, was never handled correctly by LibSass so far! We just started to "somewhat" support it.

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

No branches or pull requests

5 participants