aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test_generate.py
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-18 21:42:40 -0500
committerCraig Jennings <c@cjennings.net>2026-06-18 21:42:40 -0500
commit64153c8d995f1603986f3b44ccbdf9ddb21dfd55 (patch)
treeaf836bca12798b2fe8f71cfcd22df3341421d9f0 /scripts/theme-studio/test_generate.py
parentfe196a307877ea69fe4922e49bafa684939d6173 (diff)
downloaddotemacs-64153c8d995f1603986f3b44ccbdf9ddb21dfd55.tar.gz
dotemacs-64153c8d995f1603986f3b44ccbdf9ddb21dfd55.zip
feat(theme-studio): widen the face model with the additive attributes
This is Phase 2 of the face-attribute expansion. The model now carries distant-fg, family, overline, inverse, and extend in final shape across all three tiers, and inherit and height are no longer package-only (a ui or syntax face can set them too). I kept bold/italic/underline/strike as the legacy booleans for now. The cutover to weight/slant and the underline/strike object forms lands in the next phase with the editor widgets that force it, so the representation and the controls that drive it move together. face_specs.py holds the canonical defaults. In app-core.js, normalizePkgFace and packagesForExport carry and emit the new attrs: distant-fg resolves through the palette like fg/bg, and each attr exports only when set, so existing presets re-export unchanged. app.js syntaxBlank, uiFaceBlank, and seedFace match the shape. Nothing changed shape, so dupre, distinguished, sterling, now, theme, and WIP all emit byte-identical themes. make check green: Python 58, Node 193, ERT 40.
Diffstat (limited to 'scripts/theme-studio/test_generate.py')
-rw-r--r--scripts/theme-studio/test_generate.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/theme-studio/test_generate.py b/scripts/theme-studio/test_generate.py
index a0ca91e06..91f8b4bd0 100644
--- a/scripts/theme-studio/test_generate.py
+++ b/scripts/theme-studio/test_generate.py
@@ -195,24 +195,42 @@ class FaceSpecDefaults(unittest.TestCase):
self.assertEqual(ui_face_spec({"bg": "#ffffff", "bold": True}), {
"fg": None,
"bg": "#ffffff",
+ "distant-fg": None,
+ "family": None,
"bold": True,
"italic": False,
"underline": False,
"strike": False,
+ "overline": None,
"box": None,
+ "inverse": False,
+ "extend": False,
+ "inherit": None,
+ "height": None,
})
+ def test_ui_face_spec_carries_inherit_and_height(self):
+ # inherit/height are no longer package-only; a ui face can set them.
+ spec = ui_face_spec({"inherit": "shadow", "height": 1.3})
+ self.assertEqual(spec["inherit"], "shadow")
+ self.assertEqual(spec["height"], 1.3)
+
def test_package_face_spec_fills_structure_fields(self):
self.assertEqual(package_face_spec({"inherit": "base", "height": 1.2}), {
"fg": None,
"bg": None,
+ "distant-fg": None,
+ "family": None,
"bold": False,
"italic": False,
"underline": False,
"strike": False,
+ "overline": None,
+ "box": None,
+ "inverse": False,
+ "extend": False,
"inherit": "base",
"height": 1.2,
- "box": None,
})
def test_generated_color_names_are_base_columns_when_legacy(self):