Skip to content

Instantly share code, notes, and snippets.

@esedic
Forked from growthboot/css-layout-hack.js
Created September 7, 2019 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esedic/ade32ae2ba809d4cd88f044b69e5a3f3 to your computer and use it in GitHub Desktop.
Save esedic/ade32ae2ba809d4cd88f044b69e5a3f3 to your computer and use it in GitHub Desktop.
// 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 domStyle = document.createElement("style");
domStyle.append(
'<style>* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
* * * * * * { background-color: rgba(255,255,0,.2) !important; }\
* * * * * * * { background-color: rgba(255,0,0,.2) !important; }\
* * * * * * * * { background-color: rgba(0,255,0,.2) !important; }\
* * * * * * * * * { background-color: rgba(0,0,255,.2) !important; }</style>'
);
document.body.appendChild(domStyle);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment