Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lizkaraffa
Created August 14, 2020 00:13
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 lizkaraffa/d43f9030d98661e3919517e15d461206 to your computer and use it in GitHub Desktop.
Save lizkaraffa/d43f9030d98661e3919517e15d461206 to your computer and use it in GitHub Desktop.
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