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/face_specs.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'scripts/theme-studio/face_specs.py') diff --git a/scripts/theme-studio/face_specs.py b/scripts/theme-studio/face_specs.py index 20894cd6d..697eec50f 100644 --- a/scripts/theme-studio/face_specs.py +++ b/scripts/theme-studio/face_specs.py @@ -5,22 +5,32 @@ from __future__ import annotations from typing import Any +# The full per-face attribute model. inherit and height live here (every tier +# can set them now, not just packages). bold/italic/underline/strike stay as the +# legacy booleans for this phase; the weight/slant/underline-object cutover lands +# with the editor widgets that force it. distant-fg, family, overline, inverse, +# and extend are added in their final shape (no legacy form to migrate). STYLE_DEFAULTS: dict[str, Any] = { "fg": None, "bg": None, + "distant-fg": None, + "family": None, "bold": False, "italic": False, "underline": False, "strike": False, + "overline": None, "box": None, -} - -PACKAGE_DEFAULTS: dict[str, Any] = { - **STYLE_DEFAULTS, + "inverse": False, + "extend": False, "inherit": None, - "height": 1, + "height": None, } +# Kept as a distinct name for callers, but inherit/height are no longer +# package-only, so the package defaults are now the same full set. +PACKAGE_DEFAULTS: dict[str, Any] = dict(STYLE_DEFAULTS) + def face_spec(spec: dict[str, Any] | None = None, *, package: bool = False) -> dict[str, Any]: out = dict(PACKAGE_DEFAULTS if package else STYLE_DEFAULTS) -- cgit v1.2.3