Skip to content

Instantly share code, notes, and snippets.

@titangene
Last active June 19, 2022 00:37
Show Gist options
  • Save titangene/edce4944912ed0bb961aefec192e9c97 to your computer and use it in GitHub Desktop.
Save titangene/edce4944912ed0bb961aefec192e9c97 to your computer and use it in GitHub Desktop.
css-layout-hack.js
// ref: https://gist.github.com/vcastroi/e0d296171842e74ad7d4eef7daf15df6
(function() {
const element = document.querySelector('#test-layout-styles');
if (element) {
document.head.removeChild(element);
} else {
const style = document.createElement('style');
style.id = 'test-layout-styles';
style.innerHTML = `
* {
background-color: rgba(255,0,0,.07) !important;
outline: 1px solid #999;
color: black !important;
}
* * { background-color: rgba(255,0,255,.07) !important; }
* * * { background-color: rgba(0,255,255,.07) !important; }
* * * * { background-color: rgba(255,255,0,.07) !important; }
* * * * * { background-color: rgba(0,255,0,.07) !important; }
* * * * * * { background-color: rgba(0,0,255,.07) !important; }
* * * * * * * { background-color: rgba(255,0,0,.07) !important; }
* * * * * * * * { background-color: rgba(255,255,0,.07) !important; }
* * * * * * * * * { background-color: rgba(0,255,255,.07) !important; }
* * * * * * * * * * { background-color: rgba(0,0,255,.07) !important; }
* * * * * * * * * * * { background-color: rgba(0,255,0,.07) !important; }
* * * * * * * * * * * * { background-color: rgba(255,255,0,.07) !important; }
* * * * * * * * * * * * * { background-color: rgba(255,0,0,.07) !important; }
`;
document.head.appendChild(style);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment