diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-16 06:11:15 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-16 06:11:15 -0500 |
| commit | 166c58d04afc07d195578e1d8e5ade7c3a53a0b7 (patch) | |
| tree | af325b28056637809d5ffa8dc5a83ede54a14f9d /scripts/theme-studio/app.js | |
| parent | 683aed64fb2987b785f25e749b809153a4ec5a99 (diff) | |
| download | dotemacs-166c58d04afc07d195578e1d8e5ade7c3a53a0b7.tar.gz dotemacs-166c58d04afc07d195578e1d8e5ade7c3a53a0b7.zip | |
feat(theme-studio): move the contrast verdict into a hover
The contrast column showed "5.4 PASS". The number's color already encodes the tier (green AAA, grey AA, red fail), so the PASS/FAIL word was redundant. I dropped it and put the WCAG meaning in the cell's hover via a pure contrastTitle helper. crHtml now renders just the colored number. verdictFor stays for the covered-overlay worst-case readout, which is unchanged.
Diffstat (limited to 'scripts/theme-studio/app.js')
| -rw-r--r-- | scripts/theme-studio/app.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/theme-studio/app.js b/scripts/theme-studio/app.js index 23307edac..07ca06fe1 100644 --- a/scripts/theme-studio/app.js +++ b/scripts/theme-studio/app.js @@ -35,7 +35,7 @@ PALETTE_GENERATOR_UI_J // The contrast-cell readout shared by every table: a WCAG ratio colored by its // table verdict. Callers compute r for their own fg/bg. function verdictFor(r,target=4.5){return r>=target?'PASS':'FAIL';} -function crHtml(r,target=4.5){const v=verdictFor(r,target);return `<span style="color:${ratingColor(r)}">${r.toFixed(1)} ${v}</span>`;} +function crHtml(r){return `<span style="color:${ratingColor(r)}" title="${esc(contrastTitle(r))}">${r.toFixed(1)}</span>`;} // Effective fg/bg with the standard fallback: an unset foreground reads as the // default fg (MAP['p']), an unset background as the ground (MAP['bg']). All three // tiers resolve their raw value through these before measuring or rendering. |
