Skip to documentation
Design system / Sources & standards
Current repository source
ADR-0112-independent-approved-appearance-themes.md
docs/decisions/ADR-0112-independent-approved-appearance-themes.md
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
# ADR-0112: Independent approved appearance themes
## Status
accepted
## Date
2026-10-29
## Context
The user approved independent tenant selections for light and dark appearance. A named dark theme must not require a light counterpart. The shared dark derivation in ADR-0111 cannot express a complete, independently chosen dark palette.
## Options considered
1. Continue adapting every light palette onto shared dark semantics.
2. Expose arbitrary semantic-token editing to tenants.
3. Select complete, code-managed light and dark presets independently (chosen).
## Decision
- Each approved catalog entry declares its appearance and supplies the existing semantic color-token contract. Catalog membership, palette values and control layout are maintained in source and design-system documentation, not fixed by this ADR.
- Tenant admins select one light appearance and one dark appearance. Users retain their browser-local Light/Dark preference under ADR-0111. A preset has no required counterpart; similarly named light/dark entries are a catalog convenience.
- Preserve existing light selection keys and custom palette records. Store dark selections at `TENANT#{tenantId}#DARK` in the same configuration table, with optional `GLOBAL#DARK` fallback. Independent records prevent a save in one appearance from overwriting the other.
- Resolve each appearance from tenant selection, global selection and the corresponding code default. Existing tenants require no backfill. Configuration failure retains a usable default; saving still requires the deployed configuration table.
- Permit one three-color custom palette per tenant **per appearance**. Preserve `CUSTOM#{tenantId}` for light and use `CUSTOM#{tenantId}#DARK` for dark. Each exposes only primary, secondary and accent. Derive surfaces and text; validate actual contrast for that appearance and choose foreground polarity through contrast comparison. Do not expose arbitrary tokens or reinterpret one appearance's custom colors as the other.
- Retain server authorization, dynamic console boundaries and the strict masquerade audit facade. The existing `tenant.theme.updated` event records the appearance and previous/current selection.
## Supersession scope
Extends ADR-0036's approved catalog and tenant/global selection model with independent appearances. Supersedes only ADR-0111's unchanged single-selection storage requirement and shared dark-token/primary-derivation policy, ADR-0037's one-custom-record limit, and ADR-0038's lightness-threshold foreground polarity. Existing custom light colors and secondary/accent normalization remain unchanged. ADR-0111's provider ownership, browser persistence, authorization, scoped portals and temporary documentation previews remain accepted.
## Rationale
Complete presets can coordinate backgrounds, text, actions and feedback without exposing unsafe token combinations. Independent selection separates tenant presentation from personal mode. Reusing the table and existing GetItem/PutItem permissions avoids new AWS resources, IAM changes and database migrations.
## Consequences
- Verify all approved presets, cross-family selection, per-mode fallback, isolated writes, audit attribution and rejected wrong-mode selections.
- Maintain real fixed-appearance management previews and temporary documentation examples. Verify readable contrast, keyboard access, narrow layouts and browser persistence.
- Ordinary palette tuning and compact-control styling do not require additional ADRs when these boundaries remain unchanged.
All sources and standards