Created
September 1, 2016 12:36
-
-
Save vdboor/bc07114a864e68501456b441576243a0 to your computer and use it in GitHub Desktop.
Place a <div id="media-debug"></div> in the HTML, and this Sass code will show the active Bootstrap media query.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Debugging for media queries | |
#media-debug { | |
position: fixed; | |
left: 0; | |
bottom: 20px; | |
color: #000; | |
font-weight: bold; | |
padding: 2px 5px; | |
z-index: 1001; | |
} | |
@media (min-width: $screen-xs-min) and (max-width: $screen-xs-max) { | |
#media-debug { background-color: #00f000; } | |
#media-debug::after { content: "Mobile (XS)"; } | |
} | |
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { | |
#media-debug { background-color: #00d000; } | |
#media-debug::after { content: "Tablet (SM)"; } | |
} | |
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) { | |
#media-debug { background-color: #00b100; } | |
#media-debug::after { content: "Desktop (MD)"; } | |
} | |
@media (min-width: $screen-lg-min) { | |
#media-debug { background-color: green; } | |
#media-debug::after { content: "Large (LG)"; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment