aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/generate.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-09 14:07:55 -0500
committerCraig Jennings <c@cjennings.net>2026-06-09 14:07:55 -0500
commitfde04d184557a1bebf93df2c6f6972a91ab91187 (patch)
tree77c6f91339c3cb905f6855bcad4a7b0d758c2678 /scripts/theme-studio/generate.py
parent392f45f4dd35d1b0c48210752546ab484436eac0 (diff)
downloaddotemacs-fde04d184557a1bebf93df2c6f6972a91ab91187.tar.gz
dotemacs-fde04d184557a1bebf93df2c6f6972a91ab91187.zip
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.
Diffstat (limited to 'scripts/theme-studio/generate.py')
-rw-r--r--scripts/theme-studio/generate.py11
1 files changed, 10 insertions, 1 deletions
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=<file>.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 = """<!doctype html><meta charset=utf-8><title>theme-studio</title>
<style>
STYLES_CSS</style>