Skip to content

Commit d1576c2

Browse files
authored
Create css_debugger.js
1 parent fb13cdf commit d1576c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

css_debugger.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function css_debugger() {
2+
if (("is_css_debugging" in window) === false) {
3+
is_css_debugging = false;
4+
}
5+
6+
if (!is_css_debugging) {
7+
var debug_css = document.createElement("style");
8+
debug_css.type = "text/css";
9+
debug_css.setAttribute("id", "css_debugger");
10+
debug_css.textContent = `
11+
*:not(path):not(g) {
12+
color: hsla(210, 100%, 100%, 0.9) !important;
13+
background: hsla(210, 100%, 50%, 0.5) !important;
14+
outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important;
15+
box-shadow: none !important;
16+
}
17+
`;
18+
document.head.appendChild(debug_css);
19+
is_css_debugging = true;
20+
}
21+
else if (is_css_debugging) {
22+
var remove = document.getElementById("css_debugger");
23+
remove.parentNode.removeChild(remove);
24+
is_css_debugging = false;
25+
}
26+
}

0 commit comments

Comments
 (0)