Zahymaka
Zahymaka

Reputation: 6621

Defining reusable media queries in SASS

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?

Upvotes: 1

Views: 501

Answers (2)

sguha
sguha

Reputation: 2197

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.

Upvotes: 3

Miikka
Miikka

Reputation: 4653

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

Upvotes: 0

Related Questions