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

Extending placeholders within media queries silently fails #317

Closed
keithamus opened this issue Mar 13, 2014 · 7 comments · Fixed by #927
Closed

Extending placeholders within media queries silently fails #317

keithamus opened this issue Mar 13, 2014 · 7 comments · Fixed by #927

Comments

@keithamus
Copy link
Member

Abstract

Extending a placeholder selector from within a media query in Sass 3.4.9 produces an error, but in Libsass 3.1.0 it produces undesirable output and does not fail.

Details

Given the following SCSS:

%foo {
  max-width: 80%;
} 

@media screen and (min-width: 300px) {
  body {
    @extend %foo;
  }
}

Expected

Sass 3.4.9 produces an error

You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend %foo" on line 7.

Actual

In Libsass 3.1.0 the output is:

body {
  max-width: 80%; }

This is obviously very undesirable. Libsass should either throw a syntax error or output no content.


edit updated Jan 5th, 2015

@NickHeiner
Copy link

👍 This issue affects me as well.

@jschulte
Copy link

jschulte commented Oct 3, 2014

The output of this test in the latest version is:

body {
  max-width: 80%; }

Rather than:

body {
  max-width: 80%; }

@media screen and (min-width: 300px) { }

While this is still incorrect, it's perhaps slightly better. It looks like some work still needs to be done to properly resolve this.

@HamptonMakes
Copy link
Member

Definitely still an error.

@kaminogi
Copy link

Please fix this.

@xzyfer
Copy link
Contributor

xzyfer commented Mar 9, 2015

@mgreter since you've confirmed this is fixed is there an existing spec to cover this case?

@mgreter
Copy link
Contributor

mgreter commented Mar 10, 2015

This is also error related!

You may not @extend an outer selector from within @media.
You may only @extend selectors within the same directive.
From "@extend %foo" on line 7.

@xzyfer
Copy link
Contributor

xzyfer commented Mar 10, 2015

Yep, my bad!

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

Successfully merging a pull request may close this issue.

7 participants