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

media queries with @include edge cases #174

Closed
kwliou opened this issue Oct 14, 2013 · 1 comment
Closed

media queries with @include edge cases #174

kwliou opened this issue Oct 14, 2013 · 1 comment

Comments

@kwliou
Copy link

kwliou commented Oct 14, 2013

Input file:

@mixin foo {
  @media (width: 0px) {
    @content;
  }
}

@mixin bar {
  @media (height: 0px) {
    prop: val2;
  }
}

@include foo {
  selector {
    @include bar;
  }
}

baz {
  prop: val;
}

@include foo {
  selector {
    @extend baz;
  }
}

The incorrect output of libsass is:

@media (width: 0px) {
  @media (height: 0px) {
    selector {
      prop: val2; } } }

baz, selector {
  prop: val; }

@media (width: 0px) { }

The output of Sass 3.2.12 is:

DEPRECATION WARNING on line 25 of main.scss:
  @extending an outer selector from within @media is deprecated.
  You may only @extend selectors within the same directive.
  This will be an error in Sass 3.3.
  It can only work once @extend is supported natively in the browser.
@media (width: 0px) and (height: 0px) {
  selector {
    prop: val2; } }

baz {
  prop: val; }
@akhleung
Copy link

akhleung commented Feb 4, 2014

Looks like the fundamental issue is that nested media queries need to be combined with some boolean algebra. Closing this in favor of #185.

@akhleung akhleung closed this as completed Feb 4, 2014
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