Skip to content

Instantly share code, notes, and snippets.

@Ivanopalas
Created February 11, 2017 18:05
Show Gist options
  • Save Ivanopalas/2f0c90c54fb7bcb01eec42821db6bdf2 to your computer and use it in GitHub Desktop.
Save Ivanopalas/2f0c90c54fb7bcb01eec42821db6bdf2 to your computer and use it in GitHub Desktop.
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-portait-only {
@media (min-width: 600px) and (max-width: 899px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-tablet-landscape-only {
@media (min-width: 900px) and (max-width: 1199px) { @content; }
}
@mixin for-desktop-up {
@media (min-width: 1200px) { @content; }
}
@mixin for-desktop-only {
@media (min-width: 1200px) and (max-width: 1799px) { @content; }
}
@mixin for-big-desktop-up {
@media (min-width: 1800px) { @content; }
}
p {
padding: 10px;
background: #aaa;
color: white;
}
.phone-up {
background: purple;
}
.phone-only {
@include for-phone-only { background: purple; }
}
.tablet-portait-only {
@include for-tablet-portait-only { background: purple; }
}
.tablet-portrait-up {
@include for-tablet-portrait-up { background: purple; }
}
.tablet-landscape-only {
@include for-tablet-landscape-only { background: purple; }
}
.tablet-landscape-up {
@include for-tablet-landscape-up { background: purple; }
}
.desktop-only {
@include for-desktop-only { background: purple; }
}
.desktop-up {
@include for-desktop-up { background: purple; }
}
.big-desktop-up {
@include for-big-desktop-up { background: purple; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment