1

I'm trying to do something like:

$media_not_desktop: '@media only screen and (max-width: 959px)';

then

.wrap {
  color: #fff;
  $media_not_desktop {
      color: #555;
  }
}

but I'm getting a syntax error. How would you do this?

1
  • Sass 3.2 is now available and stable. I did something similar because I wanted to reuse my media queries and create Responsive Web easily. Check my mixins: paranoida.github.com/sass-mediaqueries
    – user797913
    Aug 24, 2012 at 20:37

2 Answers 2

3

You can do this in sass 3.2, currently available as an alpha release http://thesassway.com/intermediate/responsive-web-design-in-sass-using-media-queries-in-sass-32 under Variables as full query.

The syntax is a little different but essentially the same functionality.

0

I believe this is currently not a possible with Sass. There's an open issue with a patch on the Sass bug tracker, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.