Skip to content

Instantly share code, notes, and snippets.

@jkmaxwell
Created November 12, 2012 22:52
Show Gist options
  • Save jkmaxwell/4062601 to your computer and use it in GitHub Desktop.
Save jkmaxwell/4062601 to your computer and use it in GitHub Desktop.
Common Media Queries + Debug (Compass/SASS)
$debug: true
=debug-display($debugText)
@if $debug == true
&::before
content: '#{$debugText}'
/* iPads (portrait and landscape) -----------
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px)
+debug-display('iPads (portrait and landscape)')
/* iPads (landscape) -----------
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape)
+debug-display('iPads (landscape)')
/* iPads (portrait) -----------
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)
+debug-display('iPads (portrait)')
/* iPhone 4 - (portrait) ----------
@media only screen and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait), only screen and (min-device-pixel-ratio: 2) and (orientation: portrait)
+debug-display('iPhone 4 - (portrait)')
/* iPhone 4 - (landscape) ----------
@media screen and (-webkit-min-device-pixel-ratio: 2) and (orientation: landscape), screen and (min-device-pixel-ratio: 2) and (orientation: landscape)
+debug-display('iPhone 4 - (landscape)')
/* Smartphones (landscape) -----------
@media only screen and (min-width: 321px) and (max-width: 480px)
+debug-display('Smartphones (landscape)')
/* Smartphones (portrait) -----------
@media only screen and (max-width: 320px)
+debug-display('Smartphones (portrait)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment