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
commit4713dda0d229994b35050e6c996f544216a4eeb3 (patch)
tree92f466d15410234d52747d75b8d4cd346b3de135 /scripts/theme-studio/generate.py
parentb9449244be9adbb32a7d9b861baf7136e602bb38 (diff)
downloaddotemacs-4713dda0d229994b35050e6c996f544216a4eeb3.tar.gz
dotemacs-4713dda0d229994b35050e6c996f544216a4eeb3.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 fb7acaa8a..9315faadb 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>