Resolved context
FGUI.theme.getContext(target) returns the target's effective Light/Dark mode, colour scheme, current Theme, Accent, site settings and a read-only copy of resolved semantic token values.
Used by the automated API audit.
Canonical context inspection and single-event integration lifecycle hooks.
FG UI 1.2.0 remains Stable. This page exercises additive 1.3 theme-composition work against the live /dev runtime.
Inspect the resolved semantic context and connect charts, maps, editors or other integrations without reaching into FG UI internals.
FGUI.theme.getContext(target) returns the target's effective Light/Dark mode, colour scheme, current Theme, Accent, site settings and a read-only copy of resolved semantic token values.
Used by the automated API audit.
fgui:theme-context-change is the one public appearance lifecycle event. Its detail contains a reason, monotonic sequence, target and fresh context snapshot.
FGUI.theme.subscribe(callback) immediately supplies the current context and returns an unsubscribe function.
Use this for application-wide integrations that need one refresh whenever FGUI appearance changes.
FGUI.theme.bind(target, callback) binds a specific chart, map or editor target. Each callback receives the target's freshly resolved local context.
If application code changes local surface classes or attributes directly, call FGUI.theme.refreshContext(target, 'application'). This publishes the same unified event without exposing token mutation APIs.
The Phase 6 API exposes context snapshots and events. It does not make internal semantic tokens writable.
FGUI.theme.events.contextChange → fgui:theme-context-changeThe same read-only context contract works across common third-party surfaces.
Use semantic.surface, semantic.text, semantic.border and semantic.accent, then redraw.
Select a Light/Dark map style from context.mode and use the semantic Accent for controls.
Synchronise editor scheme, background, text and selection without writing FGUI tokens.