Skip to content

API Variable UIPreferences

github-actions[bot] edited this page Nov 27, 2026 · 1 revision

Variable: UIPreferences

const UIPreferences: object;

Defined in: src/engine/ui/preferences.ts:110

The player's UI preferences (ADR 0431): reduced motion and colour scheme, as CSS @media and Svelte read them.

Type Declaration

colorScheme

Get Signature

get colorScheme(): UIColorScheme;

The colour scheme the player prefers: their choice, else the system's. Set null to follow the system again.

Returns

UIColorScheme

Set Signature

set colorScheme(value): void;
Parameters
value

UIColorScheme | null

Returns

void

reducedMotion

Get Signature

get reducedMotion(): boolean;

Whether the player prefers reduced motion: their choice, else the system's. Set null to follow the system again.

Returns

boolean

Set Signature

set reducedMotion(value): void;
Parameters
value

boolean | null

Returns

void

onChange()

onChange(fn): () => void;

Call fn after every change (the player's or the system's); returns the unsubscribe.

Parameters

fn

() => void

Returns

() => void

reset()

reset(): void;

Follow the system's preferences again; the saved values are deleted.

Returns

void

Clone this wiki locally