Kitto.Config.Theme
Typed config reader for the colour-theme domain (Config.yaml node Theme and its per-mode sub-nodes Light / Dark). Part of the per-domain organization of the config metadata (replacing the monolithic Kitto.Metadata.SubNodes). Carries the [YamlNode]/[YamlSubNode] attributes that KIDE reads via RTTI for the Config editor; runtime consumption goes through the TKThemeConfig class methods (which operate on the raw Theme TEFNode).
TKThemeModeConfig class
Per-mode theme palette (sub-node Light / Dark of Theme). YAML path: Theme/Light, Theme/Dark
TKThemeConfig class
Application colour theme. Single root node with the active Mode, the end-user opt-in, the shared font/icon settings, and the per-mode palettes (Light / Dark sub-nodes). Replaces the old flat Theme: <Mode> / sibling-Theme-nodes models.
All runtime consumption goes through the class methods (which operate on the raw Theme TEFNode), keeping every Theme read encapsulated here:
- TKWebApplication.RenderHTMLHead → DataThemeAttr / BuildBootScript / BuildStyleBlock / ResolveIconStyle / ResolveIconSize
- TKXThemeSwitcherController → IsUserSelectionEnabled
YAML path: Theme
Theme:
Mode: Auto
UserSelection: True
Font-Family: Segoe UI
Font-Size: 13px
IconStyle: outlined
IconSize: Medium
Light:
Primary-Color: FireBrick
Dark:
Primary-Color: Goldclass function ResolveMode(const AThemeNode: TEFNode): string;Active mode as lowercase 'auto' | 'light' | 'dark'. Reads Theme/Mode, falling back to the node value (old Theme: <Mode> format), else 'auto'.
class function DataThemeAttr(const AThemeNode: TEFNode): string;The html data-theme attribute: ' data-theme="light"' / '"dark"', or '' for Auto (CSS @media handles the OS preference).
class function IsUserSelectionEnabled(const AThemeNode: TEFNode): Boolean;True when Mode=Auto and Theme/UserSelection is True — gates the switcher.
class function ResolveIconStyle(const AThemeNode: TEFNode): string;Theme/IconStyle as a YAML string (default 'filled'); nil node -> default.
class function ResolveIconSize(const AThemeNode: TEFNode): string;Theme/IconSize as a YAML string (default 'Medium'); nil node -> default.
class function BuildBootScript(const AThemeNode: TEFNode;FOUC-safe inline boot <script> for <head> — applies the localStorage theme override before CSS paints. '' unless Mode=Auto + UserSelection.
class function BuildStyleBlock(const AThemeNode: TEFNode): string;The <style> block: :root (light palette) + html[data-theme="dark"] + prefers-color-scheme media query (dark palette, only if a dark Primary-Color resolves). '' when nothing to override.
