mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
green mode slop 1
This commit is contained in:
@@ -10,3 +10,4 @@ export {
|
||||
normalizePageThemeKey,
|
||||
} from './catalog.js';
|
||||
export { themeGapClass, themeStackClass } from './layout.js';
|
||||
export { default as usePageThemeClass } from './usePageThemeClass.js';
|
||||
|
||||
@@ -24,3 +24,10 @@
|
||||
background-color: #000000;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.page-theme-green-mode {
|
||||
/* The deliberately blunt solid lime canvas is a temporary server mode, not
|
||||
a selectable personal theme, so it belongs outside the persisted catalog. */
|
||||
background-color: #00ff00;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// Active Page Theme Hook
|
||||
// Purpose: Resolves personal theme settings together with temporary server-owned theme overrides.
|
||||
// Scope: Keeps page shells unaware of individual modes while preserving the pure catalog helpers.
|
||||
import { useSessionSelector } from '../context/SessionContext.jsx';
|
||||
import { getPageThemeClass } from './catalog.js';
|
||||
|
||||
export default function usePageThemeClass(backgroundTheme) {
|
||||
const greenMode = useSessionSelector((state) => Boolean(state.session?.greenMode));
|
||||
|
||||
/*
|
||||
Green mode is a temporary server-wide theme, so it wins at resolution time
|
||||
without modifying the user's persisted theme selection. Every page consumes
|
||||
this hook and therefore receives future server theme overrides consistently.
|
||||
*/
|
||||
if (greenMode) return 'page-theme page-theme-green-mode';
|
||||
return getPageThemeClass(backgroundTheme);
|
||||
}
|
||||
Reference in New Issue
Block a user