diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-08 02:56:39 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-08 02:56:39 -0500 |
| commit | f06b93b49c4543cb8dfc3d290d37beeac6653208 (patch) | |
| tree | 5114313497797dbf3b6e8a4ee133b68a04950a3d /todo.org | |
| parent | 13e703902d76e7f3593d046e2b892084a365fe8a (diff) | |
| download | dotemacs-f06b93b49c4543cb8dfc3d290d37beeac6653208.tar.gz dotemacs-f06b93b49c4543cb8dfc3d290d37beeac6653208.zip | |
feat(theme-selector): convert theme.json into a loadable deftheme
build-theme.el is the last link in the theme-selector pipeline: a theme.json export becomes a single self-contained themes/<name>-theme.el. All four tiers convert: default from assignments.bg/.p, the syntax categories to their font-lock/tree-sitter faces with the bold/italic sets applied, UI passthrough, and package faces with :inherit/:height/weight/slant.
The output is a flat generated deftheme, not the palette/faces/theme trio the hand-authored dupre ships. A theme.json carries resolved per-face hex, not dupre's semantic-mapping layer, so a flat deftheme is the faithful output and never clobbers the curated dupre files.
I omitted the dec (decorator) key: Emacs has no dedicated decorator face and renders decorators with font-lock-type-face, which the type key already owns, so coloring dec independently would clobber types. Decorators follow the type color, as they do in stock Emacs.
20 ERT tests cover the attribute builder, each tier, the dec omission, and an end-to-end convert-and-load with a WCAG-AA assertion on the round-tripped default.
Diffstat (limited to 'todo.org')
| -rw-r--r-- | todo.org | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -41,7 +41,10 @@ Tags are additive. For example, a small wrong-behavior fix can be =:bug:quick:=, and a feature that requires internal restructuring can be =:feature:refactor:=. * Emacs Open Work -** TODO [#A] theme-selector theme.json -> dupre-*.el converter :feature:theme:theme-selector: +** DONE [#A] theme-selector theme.json -> dupre-*.el converter :feature:theme:theme-selector: +CLOSED: [2026-06-08 Mon] +Built as scripts/theme-selector/build-theme.el (sibling to build-inventory.el), emitting a single self-contained themes/<name>-theme.el deftheme (not the palette/faces/theme trio — a theme.json carries resolved per-face hex, not dupre's semantic layer). All four tiers convert: default from assignments.bg/.p, syntax categories -> font-lock/tree-sitter faces with bold/italic sets, UI passthrough, packages with :inherit/:height/weight/slant. 20 ERT tests in tests/test-build-theme.el (Normal/Boundary/Error + an end-to-end load + a WCAG-AA assertion on the round-tripped result). One mapping limitation documented: the dec (decorator) key has no independent Emacs face (Emacs renders decorators with font-lock-type-face, which ty owns), so dec is omitted and decorators follow the type color. + The last link in the pipeline: turn a theme.json exported by the theme-selector into a real loadable Emacs theme. Elisp (per Craig), TDD — this is the correctness-sensitive piece. Inputs (all on disk; no chat history needed): |
