MCPcopy Create free account
hub / github.com/ShipSecAI/studio / applyTheme

Function applyTheme

frontend/src/store/themeStore.ts:50–69  ·  view source on GitHub ↗
(theme: Theme)

Source from the content-addressed store, hash-verified

48);
49
50function applyTheme(theme: Theme) {
51 const root = document.documentElement;
52
53 // Disable transitions during the prompt switch to prevent "jank"
54 // where different elements transition at different speeds.
55 root.classList.add('theme-switching');
56
57 if (theme === 'dark') {
58 root.classList.add('dark');
59 } else {
60 root.classList.remove('dark');
61 }
62
63 // Force reflow to flush changes while transitions are disabled
64 // eslint-disable-next-line @typescript-eslint/no-unused-expressions
65 root.offsetHeight;
66
67 // Re-enable transitions
68 root.classList.remove('theme-switching');
69}
70
71// Initialize theme on module load (handles initial page load)
72export function initializeTheme() {

Callers 2

themeStore.tsFile · 0.85
initializeThemeFunction · 0.85

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected