Skip to content

Regression with @extends and @media #2019

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

Closed
paulfalgout opened this issue Apr 21, 2016 · 4 comments
Closed

Regression with @extends and @media #2019

paulfalgout opened this issue Apr 21, 2016 · 4 comments

Comments

@paulfalgout
Copy link

I have a feeling this won't be a popular bug, but it seems like a different edge case from #2009 and #2007

I wasn't seeing this in libsass v3.3.2

I think I've isolated the problem to this:

@mixin mq($points, $directions: min, $dimensions: width) {
    $query: '';
    @for $i from 1 through length($points) {
        $query: $query + ' and (#{nth($directions, $i)}-#{nth($dimensions, $i)}: #{nth($points, $i)})';
    }

    @media screen #{$query} {
        @content;
}
}

%color {
    color: #F00;
}


.foo {
    @extend %color;
    padding: 10px;

    @include mq($bp-medium, min, width) {
        padding: 30px;
    }
}

and getting "You may not @extend an outer selector from within @media"

@mgreter
Copy link
Contributor

mgreter commented Apr 21, 2016

Your sample (once I added the missing pieces) compiles correctly!
Closing since no version was stated, so I guess it was not the latest!

@mgreter mgreter closed this as completed Apr 21, 2016
@paulfalgout
Copy link
Author

Ah the sourcemap inspector will be useful. I guess I need to trace down the issue more.

With 0 code changes I did a fresh install of gulp-sass ~2.2.0 which has a dependency on node-sass of ^3.4.1 and node-sass 3.5.x recently updated libsass such that I am now using 3.3.5

If I force gulp-sass to use node-sass 3.4.1 which uses libsass 3.3.2 this error goes away

@paulfalgout
Copy link
Author

paulfalgout commented Apr 21, 2016

So perhaps I'm running into a legitimate error that wasn't thrown in the earlier versions. Upon closer inspection of the error I was looking at the wrong line trying to make an example: Here's what breaks:
example @mgreter is this specifically what the error is addressing or is this a regression?

With libsass 3.3.2 it would output with no error:

.screening__item.highlight label {
  box-shadow: inset 0 0 0 1px #0582DA;
}

@mgreter
Copy link
Contributor

mgreter commented Apr 21, 2016

Now take that snippet and enter into http://www.sassmeister.com/ to see what official ruby sass thinks about the code snippet (hint: the same as libsass does now). So this was fixed in libsass recently.

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

No branches or pull requests

2 participants