1 parent 47e920a commit cac8444Copy full SHA for cac8444
1 file changed
assets/javascripts/theme-palette.js
@@ -56,6 +56,12 @@
56
}
57
58
function getCssVar(name) {
59
+ const body = document.body;
60
+ if (body instanceof HTMLElement) {
61
+ const v = getComputedStyle(body).getPropertyValue(name).trim();
62
+ if (v) return v;
63
+ }
64
+
65
const root = document.documentElement;
66
if (!(root instanceof HTMLElement)) return "";
67
return getComputedStyle(root).getPropertyValue(name).trim();
0 commit comments