Created
August 14, 2020 00:13
-
-
Save lizkaraffa/d43f9030d98661e3919517e15d461206 to your computer and use it in GitHub Desktop.
Media Query 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
/* Be sure to set these in your variables partial for this mixin to work | |
* $mobile_width | |
* $tablet_width | |
* $desktop_width | |
* $wpadmin_width | |
*/ | |
@mixin media( $res ) { | |
@if mobile == $res { | |
@media only screen and (min-width: $mobile_width) { | |
@content; | |
} | |
} | |
@if tablet == $res { | |
@media only screen and (min-width: $tablet_width) { | |
@content; | |
} | |
} | |
@if desktop == $res { | |
@media only screen and (min-width: $desktop_width) { | |
@content; | |
} | |
} | |
@if wp-admin == $res { | |
@media only screen and (min-width: $wpadmin_width) { | |
@content; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment