Last active
August 29, 2015 14:13
-
-
Save tujlaky/7be462956ae0728dd5dc to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// ---- | |
@function create-media-query($min-width: null, $max-width: null, $retina: false, $dpr: 1.5, $media: 'only-screen') { | |
$query: $media + ' '; | |
@if $min-width { | |
$query: $query + ' and (min-width: ' + $min-width + ')'; | |
} | |
@if $max-width { | |
$query: $query + ' and (max-width: ' + $max-width + ')'; | |
} | |
@if $retina { | |
// TODO: add min-resolution | |
$query: $query + ' and (-webkit-min-device-pixel-ratio: ' + $dpr + ')'; | |
} | |
@return $query; | |
}; | |
@mixin max-width($width, $retina: false) { | |
$query: create-media-query(null, $width, $retina, 2); | |
@media #{$query} { | |
@content; | |
} | |
} | |
.test { | |
@include max-width(1024, true) { | |
width: 100%; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media only-screen and (max-width: 1024) and (-webkit-min-device-pixel-ratio: 2) { | |
.test { | |
width: 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment