MCPcopy Index your code
hub / github.com/python/cpython / toggleAndSaveTheme

Function toggleAndSaveTheme

Lib/profiling/sampling/_shared_assets/base.js:31–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30// Toggle theme and save preference. Returns the new theme.
31function toggleAndSaveTheme() {
32 const current = document.documentElement.getAttribute('data-theme') || 'light';
33 const next = current === 'light' ? 'dark' : 'light';
34 applyTheme(next);
35 localStorage.setItem(THEME_STORAGE_KEY, next);
36 return next;
37}
38
39// ============================================================================
40// Toggle Switch UI

Callers 3

toggleThemeFunction · 0.85
toggleThemeFunction · 0.85
toggleThemeFunction · 0.85

Calls 2

applyThemeFunction · 0.85
getAttributeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…