Capability first · transport second

AppearancePreferences.js

Defines, stores, and applies color scheme, density, reduced motion, and large-text preferences.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Defines, stores, and applies color scheme, density, reduced motion, and large-text preferences.

  • Artifact
    AppearancePreferences.js · esm
  • Classification
    public first party
  • Availability
    Browser / native WebView hybrid
  • Normalization
    Normalized values; storage/host failures remain mixed.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/AppearancePreferences.js';

May load or save through PreferenceStore and mutates root data attributes plus fontSize.

Application-facing behavior: appearancePreferenceSchema, createAppearancePreferenceStore(), applyAppearancePreferences(), loadAndApplyAppearancePreferences().

Protocol and host implementation

PreferenceStore, DOM, optional Arcane preferences This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
appearancePreferenceSchemavariable · valuevariable appearancePreferenceSchema
createAppearancePreferenceStorefunctionfunction createAppearancePreferenceStore(options={})options={}
applyAppearancePreferencesfunctionfunction applyAppearancePreferences(values={},root=document.documentElement)values={},root=document.documentElement
loadAndApplyAppearancePreferencesfunctionasync function loadAndApplyAppearancePreferences(options={})options={}
CallableKindExact public signatureParameter syntax
createAppearancePreferenceStoreexported-functionfunction createAppearancePreferenceStore(options={})options={}
applyAppearancePreferencesexported-functionfunction applyAppearancePreferences(values={},root=document.documentElement)values={},root=document.documentElement
loadAndApplyAppearancePreferencesexported-functionasync function loadAndApplyAppearancePreferences(options={})options={}

Parameter meanings and results

createAppearancePreferenceStore(options) returns the shared store. applyAppearancePreferences(values, root) returns values after applying scheme, density, motion, and text preferences; loadAndApplyAppearancePreferences(options) returns {store, values}.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • Preference storage and DOM failures propagate

Availability and capabilities

Browser / native WebView hybrid. Normalized values; storage/host failures remain mixed.

Uses Arcane preferences when available or browser storage through PreferenceStore; the rendered contract is host-normalized.

Contract example

JavaScript
import {applyAppearancePreferences} from '/arcane/modules/AppearancePreferences.js';

applyAppearancePreferences({
    'appearance.colorScheme':'dark',
    'appearance.density':'compact',
    'accessibility.reduceMotion':true,
    'accessibility.largeText':false
},document.documentElement);