Skip to content

Instantly share code, notes, and snippets.

@humayunahmed8
Created December 27, 2017 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humayunahmed8/6b8c79275fbf0b006cada25d030c97c8 to your computer and use it in GitHub Desktop.
Save humayunahmed8/6b8c79275fbf0b006cada25d030c97c8 to your computer and use it in GitHub Desktop.
Sass responsive Media with if, else & Dynamic Media Query with Mixin
/*==============================
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