diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-09 05:11:51 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-09 05:11:51 -0500 |
| commit | 08890fbe76476c5918fedc6ae922913fc3aac4a7 (patch) | |
| tree | 93b5e0cc91325f6018cbc5aceb582f728c18ea1e /scripts/theme-studio/styles.css | |
| parent | f2be964efb3fd49b4091a5ef667e940f7b723ad3 (diff) | |
| download | dotemacs-08890fbe76476c5918fedc6ae922913fc3aac4a7.tar.gz dotemacs-08890fbe76476c5918fedc6ae922913fc3aac4a7.zip | |
refactor(theme-studio): extract crHtml and mkStyleButtons table helpers
Three tables repeated two scaffolds. The contrast-cell readout (a WCAG ratio colored by its AA/AAA rating, plus the rating word) was copy-pasted at five sites; pulled the shared formatting into crHtml(r) and called it from the syntax, UI, and package cells (the picker readout renders differently and stays as is). The B/I/U/S style-button loop was duplicated near-verbatim in the UI and package tables; pulled it into mkStyleButtons(isOn, onToggle), which returns the button list so the caller still hands them to mkLockCell.
Left the syntax table's bold/italic buttons alone — two buttons, a different state model (the BOLD/ITALIC dicts), and an in-place refresh closure make it a poor fit for the same helper. Didn't introduce a shared row scaffold either; the three tables differ enough in columns and order that one would leak.
Behavior-preserving: the runtime-rendered tables are byte-identical to before (a DOM dump diff shows only the inline-script source changing, never a built tr/td/button/span). All hash gates, the node suite, and #locktest stay green.
Diffstat (limited to 'scripts/theme-studio/styles.css')
0 files changed, 0 insertions, 0 deletions
