diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 15:17:59 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 15:17:59 -0500 |
| commit | 6c8349c25a85543672d9c295bd8be21597d3ffc8 (patch) | |
| tree | e5a4360d55cd019a17a48f2449d9459b4b3faca6 /scripts/theme-studio/face_specs.py | |
| parent | 150cb7825e29b369f0a466750ca5b096bb303c11 (diff) | |
| download | dotemacs-6c8349c25a85543672d9c295bd8be21597d3ffc8.tar.gz dotemacs-6c8349c25a85543672d9c295bd8be21597d3ffc8.zip | |
Refactor theme studio face assembly
Diffstat (limited to 'scripts/theme-studio/face_specs.py')
| -rw-r--r-- | scripts/theme-studio/face_specs.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/theme-studio/face_specs.py b/scripts/theme-studio/face_specs.py new file mode 100644 index 000000000..32de68e08 --- /dev/null +++ b/scripts/theme-studio/face_specs.py @@ -0,0 +1,37 @@ +"""Shared face-spec defaults for theme-studio generation.""" + +from __future__ import annotations + +from typing import Any + + +STYLE_DEFAULTS: dict[str, Any] = { + "fg": None, + "bg": None, + "bold": False, + "italic": False, + "underline": False, + "strike": False, +} + +PACKAGE_DEFAULTS: dict[str, Any] = { + **STYLE_DEFAULTS, + "inherit": None, + "height": 1, + "box": None, +} + + +def face_spec(spec: dict[str, Any] | None = None, *, package: bool = False) -> dict[str, Any]: + out = dict(PACKAGE_DEFAULTS if package else STYLE_DEFAULTS) + if spec: + out.update(spec) + return out + + +def ui_face_spec(spec: dict[str, Any] | None = None) -> dict[str, Any]: + return face_spec(spec, package=False) + + +def package_face_spec(spec: dict[str, Any] | None = None) -> dict[str, Any]: + return face_spec(spec, package=True) |
