MCPcopy Index your code
hub / github.com/tinyplex/tinybase / update

Function update

site/js/common/dark.ts:9–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7export const darkLoad = () => {
8 const pref = matchMedia('(prefers-color-scheme: dark)');
9 const update = () => {
10 const dark = localStorage.getItem(DARK) ?? AUTO;
11 query('#dark')?.setAttribute('class', dark);
12 query('html').className =
13 dark == DARK || (dark == AUTO && pref.matches) ? DARK : LIGHT;
14 };
15 pref.addEventListener('change', update);
16 window.addEventListener('storage', (event) => {
17 if (event.storageArea == localStorage && event.key == DARK) {

Callers 1

darkLoadFunction · 0.85

Calls 1

queryFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…