Is there a fast easy way to query the console for the column category (xs sm md lg) used in the current viewport size?
Asked
Active
Viewed 229 times
3 Answers
1
Ok, I wrote a simple function for this, seems there is no native way to do this.
function bootstrapSize() {
switch(true) {
case window.innerWidth > 1200: return 'lg';
case window.innerWidth > 992: return 'md';
case window.innerWidth > 768: return 'sm';
default: return 'xs';
}
}

Octavian
- 4,519
- 8
- 28
- 39
0
There is no built-in way to do this from the console, but you might use the technique described in https://stackoverflow.com/a/22885503/65971 to create your code snippet to query this from the console.
For each breakpoint it creates a <div>
for example <div class="visible-xs-block" />
on which it tests if it's visible.