Skip to content

Instantly share code, notes, and snippets.

@hexandcube
Last active February 8, 2021 12:00
Show Gist options
  • Save hexandcube/cbfb2886e7cbed6617b60e72634e2136 to your computer and use it in GitHub Desktop.
Save hexandcube/cbfb2886e7cbed6617b60e72634e2136 to your computer and use it in GitHub Desktop.
Bulma screen debugger by Hexandcube - displays the current breakpoint in the bottom-left corner of the screen

Bulma screen debug by Hexandcube

  1. Put screendebug.scss in the same directory as your Bulma.sass file,
  2. Import screendebug in your bulma.sass file using `@import "screendebug"
  3. Add a div with id="screendebug" as a first child, and wrap the rest of the page in a seperate div
<body>
  <div id="screendebug"></div>
  <div class="pagewrapper"></div>
    {{ Content }}
  </div>
</body>

Demo

Demo

// Bulma screen debugger by Hexandcube - displays the current breakpoint in the bottom-left corner of the screen
// Requires <div id="screendebug"></div> that is a direct child of <body>,
// and a sibling of the main page container.
// Example structure:
// <body>
// <div id="screendebug"></div>
// <div id="pageContainer">
// {{ page content }}
// </div>
#screendebug::after {
z-index: 500;
content: "Mobile";
position: fixed;
background: black;
color: white;
padding: 3px 6px;
left: 0;
bottom: 0;
}
@media (min-width: $tablet) {
#screendebug::after {
content: "Tablet";
}
}
@media (min-width: $desktop) {
#screendebug::after {
content: "Desktop";
}
}
@media (min-width: $widescreen) {
#screendebug::after {
content: "Widescreen";
}
}
@media (min-width: $fullhd) {
#screendebug::after {
content: "FullHD";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment