Created
December 27, 2017 14:49
-
-
Save humayunahmed8/6b8c79275fbf0b006cada25d030c97c8 to your computer and use it in GitHub Desktop.
Sass responsive Media with if, else & Dynamic Media Query with Mixin
This file contains 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 Advanced Media Query | |
===============================*/ | |
@mixin mq($value){ | |
@if $value == 'medium' { | |
@media only screen and (min-width: 992px) and (max-width: 1200px) { | |
@content; | |
}/* Large devices (desktops, 992px and up) */ | |
} @elseif | |
$value == 'tab' { | |
@media only screen and (min-width: 768px) and (max-width: 991px) { | |
@content; | |
} /* Medium devices (tablets, 768px and up) */ | |
} @elseif | |
$value == 'mobile' { | |
@media only screen and (max-width: 767px) { | |
@content; | |
} /* Moblie devices (mobile, 0px to 768px) */ | |
} @elseif | |
$value == 'widemobile' { | |
@media only screen and (min-width: 480px) and (max-width: 767px) { | |
@content; | |
} /* Wide Mobile Layout: 480px. */ | |
} | |
} /* End Mixin */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment