14
Client API & Theme Management
Nxpress injects client-side utilities and flicker-free dark mode controls under window.__nxpress__.
Theme Management API (window.__nxpress__.theme)
Usage in View Templates
| Method | Return Type | Description |
|---|---|---|
| window.__nxpress__.theme.get() | 'dark' | 'light' | Returns the currently active theme preference. |
| window.__nxpress__.theme.set(mode) | void | Sets theme mode ('dark', 'light', 'system') and persists in localStorage. |
| window.__nxpress__.theme.toggle() | 'dark' | 'light' | Toggles theme mode between dark and light, returning the new state. |