Skip to content

Instantly share code, notes, and snippets.

@chrisjlee
Last active January 6, 2024 12:36
Show Gist options
  • Save chrisjlee/5832418 to your computer and use it in GitHub Desktop.
Save chrisjlee/5832418 to your computer and use it in GitHub Desktop.
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
$mobile-screen: 690px;
$tablet-screen: 995px;
$desktop-screen: 1440px;
$screen: "only screen";
$mobile: "only screen and (max-width:#{$mobile-screen})";
$tablet: "only screen and (min-width:#{$mobile-screen}) and (max-width: #{$tablet-screen})";
$desktop: "only screen and (min-width:#{$tablet-screen})";
$landscape: "only screen and (orientation: landscape)";
$portrait: "only screen and (orientation: portrait)";
@Mohsen322
Copy link

thank you

@Uhelliton
Copy link

Nice

@didacus
Copy link

didacus commented May 21, 2017

How can I use these?
Thank you in advance.

@tieutantan
Copy link

Thanks

@Mmgfrog
Copy link

Mmgfrog commented Oct 16, 2017

Very helpful, thank you.

@roni-estein
Copy link

thx

@suchislife801
Copy link

suchislife801 commented Feb 4, 2018

Greetings. Thank you for this. I was hoping that when you get some time, if you could explain the min-width choices you've made a little more in depth that would be fantastic. I'm new to media queries and I'm seriously enjoying it. Thanks again for this gem!

@moonbyt3
Copy link

moonbyt3 commented Apr 17, 2018

this is really the gem :D thank you
to use this, media query must be written
@media #{$mobile} { .yourClass { //css attributes } }
since $mobile variable holds the text "only screen and (min-width:#{$mobile-screen}) and (max-width: #{$tablet-screen})" and so on.

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