1 parent f96847d commit f8fa155Copy full SHA for f8fa155
1 file changed
docs/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