Last active
September 23, 2022 13:47
-
-
Save JanDW/35f433cc6a84cd12bad6753febf51513 to your computer and use it in GitHub Desktop.
Applies outline and background-color in order to more readily understand layouts.
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
if (!document.querySelector("#debugStyles")) { | |
const style = document.createElement("style"); | |
style.setAttribute("id", "debugStyles"); | |
style.innerHTML = ` | |
.debug-boxes * { | |
outline: 1px solid blue; | |
background-color: rgba(0,255,255,.05); | |
} | |
`; | |
document.head.appendChild(style); | |
console.info("Debug CSS added to document head"); | |
} | |
$0.classList.add("debug-boxes"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste as a snippet in your devtools and select the DOM node subtree you want boxed out and run from the command palette.