aboutsummaryrefslogtreecommitdiff
path: root/tests/test-build-theme.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-09 12:33:51 -0500
committerCraig Jennings <c@cjennings.net>2026-06-09 12:33:51 -0500
commit85c1fcf7925f5d74bbbe8e36c56ee18f7f1314ec (patch)
tree1e198067ad0438ee7eab26f1025ef40e5208b67c /tests/test-build-theme.el
parent126a4e977cbde3b4e91823cd1ea126d054a51be1 (diff)
downloaddotemacs-85c1fcf7925f5d74bbbe8e36c56ee18f7f1314ec.tar.gz
dotemacs-85c1fcf7925f5d74bbbe8e36c56ee18f7f1314ec.zip
feat(theme-studio): add a real, exported :box face attribute
The mode-line box in the preview was hardcoded — it showed a box the generated theme couldn't actually produce, since build-theme.el never emitted :box. Made :box a real face attribute instead: a per-face box object (style line/raised/pressed, width, color) stored on UI and package faces, set from a "box" dropdown in both tables, rendered from the attribute everywhere (the mode-line bars, the package previews via ofs, the UI table preview cells), and exported through build-theme.el's --attrs as a proper :box plist (released/pressed → :style *-button; line → :line-width + optional :color). The hardcoded box is gone; mode-line and mode-line-inactive now default to the released-button box that is the Emacs default, so the preview and the export agree. This also gives the package faces that genuinely use :box a way to represent it — the face audit found several (magit-branch-current/-remote-head, two flycheck list faces, the telega button family, ~15 slack button/dialog faces). Tests: build-theme gains box-conversion + ui-box-emit ERT tests (24/24); the app-core deep-equal tests account for the new box slot; all 9 browser gates, 20 python, and 55 node tests stay green.
Diffstat (limited to 'tests/test-build-theme.el')
-rw-r--r--tests/test-build-theme.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test-build-theme.el b/tests/test-build-theme.el
index f74b9417..87b17e0a 100644
--- a/tests/test-build-theme.el
+++ b/tests/test-build-theme.el
@@ -192,6 +192,27 @@ mapping dec would clobber the type color."
(should (member '(region ((t (:background "#264364")))) specs))
(should (member '(mode-line ((t (:foreground "#cdced1" :background "#2f343a")))) specs))))
+(ert-deftest test-build-theme-box-styles ()
+ "Normal/Boundary: a face box spec converts to the right Emacs :box value."
+ (should (equal (build-theme/--box '((style . "released") (width . 1)))
+ '(:line-width 1 :style released-button)))
+ (should (equal (build-theme/--box '((style . "pressed") (width . 2)))
+ '(:line-width 2 :style pressed-button)))
+ (should (equal (build-theme/--box '((style . "line") (color . "#67809c")))
+ '(:line-width 1 :color "#67809c")))
+ (should (equal (build-theme/--box '((style . "line"))) '(:line-width 1)))
+ (should (null (build-theme/--box nil)))
+ (should (null (build-theme/--box '((style . "none"))))))
+
+(ert-deftest test-build-theme-ui-face-emits-box ()
+ "Normal: a ui face with a box exports a :box attribute."
+ (let ((specs (build-theme/--ui-face-specs
+ '((mode-line . ((fg . "#cdced1") (bg . "#2f343a")
+ (box . ((style . "released") (width . 1)))))))))
+ (should (member '(mode-line ((t (:foreground "#cdced1" :background "#2f343a"
+ :box (:line-width 1 :style released-button)))))
+ specs))))
+
;;; ---------------------------------------------------------------------------
;;; Package tier