Function
getVar
(name, el = document.body)
Source from the content-addressed store, hash-verified
| 9 | let lastBgPrimary = ''; |
| 10 | const themesync = async () => { |
| 11 | const getVar = (name, el = document.body) => el && (getComputedStyle(el).getPropertyValue(name) || getVar(name, el.parentElement))?.trim(); |
| 12 | |
| 13 | const bgPrimary = getVar('--background-primary'); |
| 14 | if (!bgPrimary || bgPrimary === '#36393f' || bgPrimary === '#fff' || bgPrimary === lastBgPrimary) return; // Default primary bg or same as last |
Tested by
no test coverage detected