From 64153c8d995f1603986f3b44ccbdf9ddb21dfd55 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 18 Jun 2026 21:42:40 -0500 Subject: 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. --- scripts/theme-studio/test_generate.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'scripts/theme-studio/test_generate.py') 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): -- cgit v1.2.3