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

Function applyTheme

Lib/profiling/sampling/_shared_assets/base.js:19–28  ·  view source on GitHub ↗
(theme)

Source from the content-addressed store, hash-verified

17
18// Apply theme and update UI
19function applyTheme(theme) {
20 document.documentElement.setAttribute('data-theme', theme);
21 const btn = document.getElementById('theme-btn');
22 if (btn) {
23 const moonIcon = btn.querySelector('.icon-moon');
24 const sunIcon = btn.querySelector('.icon-sun');
25 if (moonIcon) moonIcon.style.display = theme === 'dark' ? 'none' : '';
26 if (sunIcon) sunIcon.style.display = theme === 'dark' ? '' : 'none';
27 }
28}
29
30// Toggle theme and save preference. Returns the new theme.
31function toggleAndSaveTheme() {

Callers 3

restoreUIStateFunction · 0.85
toggleAndSaveThemeFunction · 0.85
restoreUIStateFunction · 0.85

Calls 2

setAttributeMethod · 0.80
getElementByIdMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…