# Textual constants.py — TEXTUAL_THEME environment default ## Metadata | Field | Value | |---|---| | Institute | Molodetz Institute — Research & Retrieval Division | | Subject | tui-framework-design | | Document type | Source Dossier | | Tier | 1 | | Source title | Textual src/textual/constants.py — TEXTUAL_THEME env handling | | Source URL | https://raw.githubusercontent.com/Textualize/textual/main/src/textual/constants.py | | Source publisher / author | Textualize (Textual project) | | Source type | repository | | Source date (published) | Unknown — not stated | | Date researched | 2026-10-11 | | Researched by | tai (agent), model: Muse Spark, on behalf of retoor | | Research method | direct page fetch | | Confidence | Medium | | Status | Active | ## Summary A thin source with one finding: the `TEXTUAL_THEME` environment variable sets the default theme, taking a first-existing-wins list. It exists here as the precedent for tai's `TAI_THEME` variable. ## Key findings - `TEXTUAL_THEME` sets the default theme from the environment, accepting a list where the first existing theme wins. ## Pros / strengths - Env-var default with first-existing-wins fallback is a small, robust precedence mechanism worth copying exactly. ## Cons / limitations / caveats - Thin source: one mechanism only, no interaction with flags or runtime switching visible here. ## Relevance to tai - Direct precedent for the palette-role conclusion's precedence chain (flag > `TAI_THEME` env var > default). ## Changelog | Date | Change | |---|---| | 2026-10-11 | Initial dossier created from 2026-10-11 research-pass evidence (body opened via web_fetch by researching agent). |