From 630cfddc7060c7019815f8e82f87fb629aefebfa Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 2 Jul 2026 23:01:54 -0400 Subject: feat(theme-studio): explicit absolute-vs-relative face height kind JSON collapses 2.0 to 2 on save, so a height's number type can't say whether it's a fixed 1/10pt value or a relative multiplier. The face model now carries an explicit heightMode field (abs/rel) through seed, save/load, and export. build-theme.el coerces :height from the kind: abs exports an integer, rel a float, so a relative 2.0 renders as 2.0, never 2. Faces saved before the field existed infer the kind once on load (JS: integer to abs, fractional to rel; Python keeps the authored type, so a float 2.0 seed stays relative) and persist it on the next save. The mode-line seed carries abs explicitly, and WIP.json's eight seeded heights are stamped with their kinds. Regenerating the theme from the stamped WIP.json produces an identical WIP-theme.el, so the round-trip holds. --- scripts/theme-studio/WIP.json | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'scripts/theme-studio/WIP.json') diff --git a/scripts/theme-studio/WIP.json b/scripts/theme-studio/WIP.json index fb6463e7..b839190a 100644 --- a/scripts/theme-studio/WIP.json +++ b/scripts/theme-studio/WIP.json @@ -943,7 +943,8 @@ "inverse": false, "extend": false, "inherit": null, - "height": 130 + "height": 130, + "heightMode": "abs" }, "mode-line-highlight": { "fg": "#e6ce88", @@ -1724,14 +1725,16 @@ "weight": "bold", "inherit": null, "height": 1.2, - "source": "user" + "source": "user", + "heightMode": "rel" }, "org-document-info": { "fg": "#ab8d2e", "bg": "#100f0f", "inherit": null, "height": 1.15, - "source": "user" + "source": "user", + "heightMode": "rel" }, "org-document-info-keyword": { "fg": "#7c838a", @@ -3848,7 +3851,8 @@ "slant": "italic", "inherit": "default", "height": 1.25, - "source": "user" + "source": "user", + "heightMode": "rel" }, "dashboard-text-banner": { "fg": "#dab53d", @@ -4667,7 +4671,8 @@ "bg": null, "inherit": "cj/nov-reading-sepia", "height": 1.2, - "source": "user" + "source": "user", + "heightMode": "rel" }, "cj/nov-reading-sepia-link": { "fg": "#5178db", @@ -6035,7 +6040,8 @@ "weight": "bold", "inherit": null, "height": 1.4, - "source": "default" + "source": "default", + "heightMode": "rel" }, "shr-h2": { "fg": "#bfc4d0", @@ -6043,7 +6049,8 @@ "weight": "bold", "inherit": null, "height": 1.2, - "source": "user" + "source": "user", + "heightMode": "rel" }, "shr-h3": { "fg": "#a6aab4", @@ -7026,7 +7033,8 @@ "weight": "bold", "inherit": null, "height": 1.1, - "source": "default" + "source": "default", + "heightMode": "rel" } }, "emms": { @@ -8986,4 +8994,4 @@ } } } -} \ No newline at end of file +} -- cgit v1.2.3