Skip to content

Instantly share code, notes, and snippets.

@codedrops-io
Created June 18, 2020 15:01
Show Gist options
  • Save codedrops-io/896fe66382c7de4b5b1507ad85321ca9 to your computer and use it in GitHub Desktop.
Save codedrops-io/896fe66382c7de4b5b1507ad85321ca9 to your computer and use it in GitHub Desktop.
Media query mixins.
// Device sizes
$phone: 599px;
$tablet-portrait: 600px;
$tablet-landscape: 900px;
$desktop: 1200px;
$desktop-big: 1800px;
// Media queries
@mixin for-phone-only {
@media (max-width: $phone) {
@content;
}
}
@mixin for-tablet-portrait-up {
@media (min-width: $tablet-portrait) {
@content;
}
}
@mixin for-tablet-landscape-up {
@media (min-width: $tablet-lanscape) {
@content;
}
}
@mixin for-desktop-up {
@media (min-width: $desktop) {
@content;
}
}
@mixin for-big-desktop-up {
@media (min-width: $desktop-big) {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment