Skip to content

Instantly share code, notes, and snippets.

@stiff
Forked from olee/css-layout-hack.js
Last active November 24, 2020 03:26
Show Gist options
  • Save stiff/51a03d378991291a69a57a4d3ed18aa1 to your computer and use it in GitHub Desktop.
Save stiff/51a03d378991291a69a57a4d3ed18aa1 to your computer and use it in GitHub Desktop.
CSS/HTML layout debugger
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
styleEl.innerHTML = 'html * { background: rgba(255, 0, 0, .1); box-shadow: 0 0 0 1px red; }';
document.body.append(styleEl);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment