Skip to content

Instantly share code, notes, and snippets.

@etelford
Created September 30, 2016 18:38
Show Gist options
  • Save etelford/87e8c7825a8c2e7532ecce99f94d88d3 to your computer and use it in GitHub Desktop.
Save etelford/87e8c7825a8c2e7532ecce99f94d88d3 to your computer and use it in GitHub Desktop.
Bootstrap Responsive Debugging
<div id="u-debug-size">
<div id="u-debug-size__inner"></div>
</div>
#u-debug-size {
z-index: 100000;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 100px;
display: block;
}
#u-debug-size__inner {
position: absolute;
bottom: 0;
left: 0;
}
#u-debug-size__inner {
padding: 10px;
}
@media (max-width: $screen-xs-max) {
#u-debug-size__inner {
color: darken(red, 30%);
background: lighten(red, 40%)
}
#u-debug-size__inner::before {
content: 'x-small';
}
}
@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
#u-debug-size__inner {
color: darken(orange, 30%);
background: lighten(orange, 40%)
}
#u-debug-size__inner::before {
content: 'small';
}
}
@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
#u-debug-size__inner {
color: darken(yellow, 30%);
background: lighten(yellow, 40%)
}
#u-debug-size__inner::before {
content: 'medium';
}
}
@media (min-width: $screen-lg-min) {
#u-debug-size__inner {
color: darken(blue, 30%);
background: lighten(blue, 40%)
}
#u-debug-size__inner::before {
content: 'large';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment