Skip to content

Instantly share code, notes, and snippets.

@lizkaraffa
Created August 14, 2020 00:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Media Query Mixin
/* 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