sass-mediaqueries icon indicating copy to clipboard operation
sass-mediaqueries copied to clipboard

Min, max range contained in a single variable?

Open wrydere opened this issue 10 years ago • 4 comments

Would it be possible to add support for a single variable containing a comma-separated range, something like:

$small_display: 768px, 960px;

So that it could be used as follows:

@include screen($small_display) { }

(Forgive me if this is already possible and I just don't understand the syntax.)

wrydere avatar Jan 15 '15 17:01 wrydere

That's a great idea. Currently it's not possible but for sure I want to implement it.

Thanks.

rafalbromirski avatar Jan 15 '15 22:01 rafalbromirski

To have all in a single parameter would be really cool to have. Thought about it today myself. I wrote a small mixing that exactly does that. There is a lot in this example to improve but it works ;)

$humptieDumptie: (0, 320, "landscape");

@mixin mqx($test){
    @include screen(nth($test, 1), nth($test, 2), nth($test, 3)){
        @content;
    }
}

@include mqx($humptieDumptie){
       font-weight: bold;
}

StfBauer avatar Oct 08 '15 07:10 StfBauer

That works to :)

I will add support for a single variable (I just wanted to release 1.6.0 first because with generator it's much easier.

rafalbromirski avatar Oct 08 '15 07:10 rafalbromirski

Thanx!

StfBauer avatar Oct 15 '15 06:10 StfBauer