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

Function getPreferredTheme

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

Source from the content-addressed store, hash-verified

10
11// Get the preferred theme from localStorage or system preference
12function getPreferredTheme() {
13 const saved = localStorage.getItem(THEME_STORAGE_KEY);
14 if (saved) return saved;
15 return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
16}
17
18// Apply theme and update UI
19function applyTheme(theme) {

Callers 2

restoreUIStateFunction · 0.85
restoreUIStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…