Repository navigation
skins: warn at the text floors tokens.css promises (fg-2 7:1, fg-3 5:1) - #269
connorburgess wants to merge 3 commits into
Conversation
Symptom: a skin whose --fg-2 is 5.3:1 and --fg-3 4.6:1 on its page (#6b6b6b and #757575 on white) is listed with no warning, although tokens.css promises secondary text at 7:1 and meta text at 5:1. Cause: shared/contrast.ts checked --fg-2 against 5 and --fg-3 against 4.5, while its own header says it measures the floors tokens.css promises. docs/skin-authoring.md repeated 5 / 4.5 in its prose, contradicting its own token table (7 / 5 / 3). Fix: TEXT_TIERS now holds --fg-2 to 7 and --fg-3 to 5; --fg, --fg-4 and the focus ring are unchanged. The header comment, the warning examples in skin-api.ts and the skin-authoring paragraph say the same. A new test in shared/contrast.test.ts fails before and passes after; the built-in skins and the stock schemes still clear every floor. Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
#276 also adds a test to |
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
|
The skin text contrast floor correction still applies to SessionPipe GUI v0.8.18. Merged current Added the previously deferred Unreleased changelog entry. Validation on this head, macOS / Node 22.23.2:
GitHub CI run 47453785785 for head Also checked the combined source/test changes from all 19 refreshed PRs on the same main: no source conflicts; typecheck, lint and build passed; all 252 unit-test files passed (3,439 tests, two skipped). This was a local integration check, separate from the individual PR run above. Release-note entries may still need combining as PRs land. |
Updated against v0.8.18 / main
d16a2c01on 2026-12-05. Current validation and refresh details.What
The skin list now warns when a skin's secondary text (
--fg-2) is under 7:1 or its meta text (--fg-3) is under 5:1 on the page or the card: the floorsweb/src/styles/tokens.csspromises. Before, it warned only under 5:1 and 4.5:1, so a skin could be listed clean while below the promised floors.Why
Symptom: a light skin with
--fg-2: #6b6b6band--fg-3: #757575(5.3:1 and 4.6:1 on white) is listed with nowarning, though tokens.css (lines 5-6) says "fg-2 is secondary body (≥ 7:1 on the page), fg-3 is meta (≥ 5:1)". On main:Cause:
shared/contrast.tssays in its header that it measures "the floors tokens.css promises", butTEXT_TIERSheld--fg-2to 5 and--fg-3to 4.5.docs/skin-authoring.mdrepeated 5 / 4.5 in its prose, contradicting its own token table a few lines up (7 / 5 / 3). The themes repo'spackages/color-themes/scripts/check.mjsalready checks--fg-2at 7 and--fg-3at 5 on--bgand--bg-2.Fix:
TEXT_TIERSholds--fg-2to 7 and--fg-3to 5.--fg(7),--fg-4(3) and the focus ring (3) are unchanged. The header comment, the warning examples inshared/skin-api.tsand the skin-authoring paragraph now give the same numbers.Wire contract (
shared/*): no shape change.InstalledSkin.warningis still an optional string. Only the numbers in it change ("needs 7" / "needs 5" in place of "needs 5" / "needs 4.5"), and some skins that had no warning now get one. A skin with a warning still applies.The themes repo's shared-types copy of
contrast.tsmirrors this file, so a later mirror refresh picks this up there.Original proof (before the v0.8.18 refresh)
New test in
shared/contrast.test.ts:#6b6b6b/#757575on the light page warn on both grounds, and#595959(7.0:1) /#6e6e6e(5.1:1) do not. The existing regex inserver/skins/skins.test.tsthat matched "needs 4.5" now matches "needs 5".With main's
shared/contrast.tsand this branch's tests, both fail:On this branch:
No shipped skin starts warning. I checked with
textTierWarningson this branch: the built-insessionpipe(dark and light) andPaper(light) skins and both stock schemes (STOCK_TEXT_TOKENS) return no warnings.npm testkeeps "every built-in clears the text-tier floors" green. No bundled view ships askin.json.docs/color-theme.example.json(the sample "Mint" color theme) already warns on main:--fg-3is 4.0:1 / 4.2:1, under the old 4.5, and--fg-4is 2.5:1 / 2.6:1, under 3. This change adds one more line to its warning,--fg-2 on --bg 6.8:1, needs 7. Its tokens are left alone here to keep this to one change. Bringing the example up to its own floors would be a small follow-up.No e2e spec asserts these warning strings, and nothing in the UI changes except the numbers in the warning text, so
npm run test:e2ewas not run.Checklist
git commit -s): the DCO is the only paperwork.npm run typecheck && npm run lint && npm testpass;npm run test:e2efor a UI change. (No UI change.)// SPDX-License-Identifier: Apache-2.0. (No new files.)--demo).shared/*names the wire-contract change in the description. (See "Wire contract" above.)CHANGELOG.md.