From fde04d184557a1bebf93df2c6f6972a91ab91187 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 9 Jun 2026 14:07:55 -0500 Subject: feat(theme-studio): make sterling the default theme, replacing dupre sterling.json becomes the canonical default: merged sterling's palette/colors with the audited face structure (today's Fidelity fixes + boxes) and pointed generate.py's default at it. The seed reader now also applies the theme's package overrides, so the no-seed page is fully sterling. THEME_STUDIO_SEED still overrides to view another palette. --- scripts/theme-studio/generate.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/theme-studio/generate.py') diff --git a/scripts/theme-studio/generate.py b/scripts/theme-studio/generate.py index fb7acaa8..9315faad 100644 --- a/scripts/theme-studio/generate.py +++ b/scripts/theme-studio/generate.py @@ -78,7 +78,9 @@ UIMAP={"cursor":{"fg":None,"bg":"#a9b2bb"},"region":{"fg":None,"bg":"#264364"}, # Placed after every default it overrides (notably UIMAP) so the merge has targets. # Mirrors what the in-page Import does, so reseed and import agree. LOCKS=[]; ITALIC=[] -_seed=os.environ.get('THEME_STUDIO_SEED') +# sterling is the default theme; THEME_STUDIO_SEED=.json overrides to view another. +_seed=os.environ.get('THEME_STUDIO_SEED') or 'sterling.json' +_d={} if _seed: _d=json.load(open(os.path.join(HERE,_seed))) if _d.get('palette'): PALETTE=_d['palette'] @@ -424,6 +426,13 @@ if os.path.exists(_inv_path): APPS[_pkg]={"label":_pkg,"preview":"generic","faces":[ [f,(f[len(_pkg)+1:] if f.startswith(_pkg+"-") else f).replace("-face","").replace("-"," "),{}] for f in _INV[_pkg]]} +# Apply the seed theme's package overrides (sterling by default): each full per-face +# spec (color + structure) replaces the hardcoded face seed before the page renders. +if _seed and _d.get('packages'): + for _app,_pkfaces in _d['packages'].items(): + if _app in APPS: + for _row in APPS[_app]['faces']: + if _row[0] in _pkfaces: _row[2]=_pkfaces[_row[0]] HTML = """theme-studio -- cgit v1.2.3