Skip to content

Commit f8fa155

Browse files
committed
Update theme-palette.js
1 parent f96847d commit f8fa155

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

docs/assets/javascripts/theme-palette.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
}
5757

5858
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+
5965
const root = document.documentElement;
6066
if (!(root instanceof HTMLElement)) return "";
6167
return getComputedStyle(root).getPropertyValue(name).trim();

0 commit comments

Comments
 (0)