Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active April 25, 2023 05:49
  • Star 81 You must be signed in to star a gist
  • Fork 38 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?
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@media (min-width: 1200px) { @content; }
}
@mixin for-big-desktop-up {
@media (min-width: 1800px) { @content; }
}
// usage
.my-box {
padding: 10px;
@include for-desktop-up {
padding: 20px;
}
}
@mblode
Copy link

mblode commented Nov 22, 2016

@mixin for-tablet-portrait-only* (Spelling mistake)

@nkhil
Copy link

nkhil commented Aug 22, 2018

Love this - found it through your 'the 100% correct way to do CSS breakpoints' article.

@gcamara
Copy link

gcamara commented Aug 14, 2021

This is great, man =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment