Skip to content

release: v0.3.6 — fix table cells unreadable in forced-colors dark mode#175

Merged
masuP9 merged 2 commits into
mainfrom
fix/table-forced-colors-dark
May 13, 2026
Merged

release: v0.3.6 — fix table cells unreadable in forced-colors dark mode#175
masuP9 merged 2 commits into
mainfrom
fix/table-forced-colors-dark

Conversation

@masuP9
Copy link
Copy Markdown
Owner

@masuP9 masuP9 commented May 13, 2026

Summary

  • Fix Table body cells rendering invisible text in Windows High Contrast Mode + dark color-scheme. The forced-color-adjust: none opt-out on .apg-table blocked system-color substitution, leaving color: var(--foreground) resolved as the light-mode (near-black) oklch value on a black Canvas background.
  • Explicitly set color: CanvasText on .apg-table-cell / .apg-table-rowheader inside the forced-colors block.
  • Override the cell hover so background stays Canvas (avoids clashing with the light-mode var(--muted) near-white value) and indicate hover with a Highlight outline.
  • Give the sort button explicit ButtonText color + Highlight hover for the same reason.
  • Grid / DataGrid / TreeGrid were verified separately: they don't set forced-color-adjust: none, so browser auto-substitution handles dark forced-colors correctly there — no changes needed.
  • Bumps version to 0.3.6 (patch).

Test plan

  • Open /patterns/table/{react,vue,svelte,astro}/ with Playwright emulateMedia({ forcedColors: 'active', colorScheme: 'dark' }):
    • All body cells render CanvasText (white) text on Canvas (black) background — names/ages/cities readable.
    • Column header still readable (ButtonText on ButtonFace).
    • Cell hover: keeps Canvas background, gains a 2px Highlight outline.
    • Sort button: ButtonText base, Highlight on hover and focus.
  • Spot-check /patterns/grid/, /patterns/data-grid/, /patterns/treegrid/ in the same emulation — all text remains readable (auto-substitution).
  • forced-colors OFF: no visual regression on Table.
  • npm run test:e2e:pattern --pattern=table passes.
  • npm run lint passes.

🤖 Generated with Claude Code

masuP9 and others added 2 commits May 13, 2026 21:59
`.apg-table` sets `forced-color-adjust: none` so system-color
substitution is opted out for the whole table. The cell rules only
specified `background: Canvas`, leaving `color` to resolve to the
base `var(--foreground)` — which becomes the light-mode oklch value
(near-black) because the project's dark mode is class-based and the
class isn't applied. Result: black text on black Canvas.

- Explicitly set `color: CanvasText` on cells and rowheaders.
- Override the cell hover to keep `background: Canvas` and indicate
  hover with a `Highlight` outline (avoids the var(--muted) value
  going near-white and clashing with CanvasText).
- Give the sort button explicit `ButtonText` / `Highlight` hover for
  the same reason.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Release the table.css forced-colors dark mode fix as v0.3.6.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying apg-patterns-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8060a2b
Status: ✅  Deploy successful!
Preview URL: https://7b04d12e.apg-patterns-examples.pages.dev
Branch Preview URL: https://fix-table-forced-colors-dark.apg-patterns-examples.pages.dev

View logs

@masuP9 masuP9 merged commit 6840437 into main May 13, 2026
17 checks passed
@masuP9 masuP9 deleted the fix/table-forced-colors-dark branch May 13, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant