MCPcopy Create free account
hub / github.com/csskit/csskit / setupThemeObserver

Function setupThemeObserver

website/script/benchmarks.js:298–314  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

296}
297
298function setupThemeObserver() {
299 const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
300
301 mediaQuery.addEventListener("change", (e) => {
302 charts.forEach((chart) => {
303 if (chart) {
304 chart.updateOptions({
305 theme: getChartTheme(),
306 grid: {
307 borderColor: getGridBorderColor(),
308 },
309 chart: getChartOptions(),
310 });
311 }
312 });
313 });
314}
315
316// --- Adaptive sampling ---
317

Callers 1

initializeChartsFunction · 0.85

Calls 3

getChartThemeFunction · 0.85
getGridBorderColorFunction · 0.85
getChartOptionsFunction · 0.85

Tested by

no test coverage detected