When building a website, it’s sometimes helpful to know which breakpoint you’re currently viewing.
This chunk adds a small colored box to your page that indicates the breakpoint.
It’s based on Bootstrap 5, but you can easily change the breakpoints, size and color.
Just make a chunk named breakpoints and add it to your page like this: [[$breakpoints]]
If you look at the code you’ll see it’s mostly stylesheet. (Stylesheets are supposed to be in the head of the webpage, but they work here anyway. Development only!)
If you use Sass, there’s a stylesheet for that below.
In action:



breakpoints chunk:
<style>
.breakpoints {
height: 30px;
text-align: center;
padding-top: 4px;
background-color: honeydew;
}
.breakpoints:before {
content: "xs";
}
@media (min-width: 576px) {
.breakpoints {
background-color: azure;
}
.breakpoints:before {
content: "sm";
}
}
@media (min-width: 768px) {
.breakpoints {
background-color: lightsteelblue;
}
.breakpoints:before {
content: "md";
}
}
@media (min-width: 992px) {
.breakpoints {
background-color: lightyellow;
}
.breakpoints:before {
content: "lg";
}
}
@media (min-width: 1200px) {
.breakpoints {
background-color: lavenderblush;
}
.breakpoints:before {
content: "xl";
}
}
@media (min-width: 1400px) {
.breakpoints {
background-color: fuchsia;
}
.breakpoints:before {
content: "xxl";
}
}
</style>
<div class="breakpoints"></div>
SCSS stylesheet
.breakpoints {
height: 30px;
text-align: center;
padding-top: 4px;
background-color: honeydew;
&:before { content: 'xs'; }
@include media-breakpoint-up(sm) {
background-color: azure;
&:before { content: 'sm'; }
}
@include media-breakpoint-up(md) {
background-color: lightsteelblue;
&:before { content: 'md'; }
}
@include media-breakpoint-up(lg) {
background-color: lightyellow;
&:before { content: 'lg'; }
}
@include media-breakpoint-up(xl) {
background-color: lavenderblush;
&:before { content: 'xl'; }
}
@include media-breakpoint-up(xxl) {
background-color: fuchsia;
&:before { content: 'xxl'; }
}
}