Skip to content

@extend outer selector from within @media should not error #1927

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
bastei opened this issue Feb 24, 2016 · 4 comments
Closed

@extend outer selector from within @media should not error #1927

bastei opened this issue Feb 24, 2016 · 4 comments

Comments

@bastei
Copy link

bastei commented Feb 24, 2016

The following scss does not compile since version 3.3.0-beta3:

@media screen {
  $variable: dynamic;
  .foo-#{$variable} {a: b}
  .bar {
    @extend .foo-dynamic
  }
}

The error is:

Error: You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend .foo-dynamic" on line 5 of test.scss
on line 3 of test.scss

With libsass 3.3.0-beta2 the output is correct:

@media screen {
  .foo-dynamic, .bar {
    a: b; } }
@xzyfer
Copy link
Contributor

xzyfer commented Feb 24, 2016

Does it compile on the more recent 3.3.3?
On Feb 25, 2016 8:14 AM, "bastei" [email protected] wrote:

The following scss does not compile since version 3.3.0-beta3:

@media screen {
$variable: dynamic;
.foo-#{$variable} {a: b}
.bar {
@extend .foo-dynamic
}
}

The error is:

Error: You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend .foo-dynamic" on line 5 of test.scss
on line 3 of test.scss

With libsass 3.3.0-beta2 the output is correct:

@media screen {
.foo-dynamic, .bar {
a: b; } }


Reply to this email directly or view it on GitHub
#1927.

@bastei
Copy link
Author

bastei commented Feb 24, 2016

Does it compile on the more recent 3.3.3?

No, it fails with the same error.

@xzyfer
Copy link
Contributor

xzyfer commented Feb 28, 2016

Thanks for the report @bastei. I can confirm this issue.

Bisect shows this regression was caused by 61b6d56.

@mgreter
Copy link
Contributor

mgreter commented Apr 5, 2016

Pretty sure that this is closely related to #1923

@mgreter mgreter changed the title Regression - @extend selector with variable inside media query @extend outer selector from within @media should not error Apr 5, 2016
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 15, 2016
@mgreter mgreter modified the milestones: 3.3.5, 3.4 Apr 15, 2016
@mgreter mgreter self-assigned this Apr 15, 2016
mgreter added a commit to mgreter/libsass that referenced this issue Apr 15, 2016
mgreter added a commit to mgreter/libsass that referenced this issue Apr 15, 2016
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