Repository navigation
Add a contrast setting, from the palette as designed to high contrast - #48
vivecuervo7 wants to merge 5 commits into
Conversation
514c70b to
88fe6a3
Compare
vivecuervo7
left a comment
There was a problem hiding this comment.
The palette changes look solid overall. Both comments are about the high-contrast end of the slider, where tokens that now scale meet tokens that stay fixed: secondary buttons fill with the ground colour on raised surfaces, and one chip hover goes dimmer instead of firmer.
| /* Clear as designed; toward high contrast it keeps the designed ground | ||
| rather than darkening with the page. */ | ||
| background: color-mix(in oklab, var(--ground) var(--toward), transparent); |
There was a problem hiding this comment.
[Minor] Toward high contrast, a secondary .btn gets a grey fill even on raised and brown surfaces.
The fill is color-mix(in oklab, var(--ground) var(--toward), transparent), so at 1 every plain .btn is solid #121315. That works for a button on the page, but many buttons sit on raised surfaces, for example:
- "Show in diff" on the brown
--popovercard (FindingCard.svelte:60) - Cancel in
ConfirmDialogon--surface - the buttons in
RoundChip's popover on--surface-2 - Composer's buttons
- "Just read" in
PanelCard
On those surfaces a clear button becomes a dark neutral block cut into the surface. It's most noticeable as grey on brown, and it goes against "what's raised above the ground keeps its colour". One option is to apply the fill only where the button sits on the page. That could be a page-level class, or a --btn-fill that raised containers reset to transparent.
There was a problem hiding this comment.
Fixed in 49ee691, a different way: secondary buttons are clear again at every contrast, and instead their edge, --control-line, firms up toward high contrast (#3a3c42 → #52555b), as the agents' and popups' edges do. That holds a button apart from a darker page and from whatever surface it sits on, without each raised container having to reset a fill. Checked in a browser at 0 and 1: buttons stay clear, and the edge firms up. --ground went with it, since --bg was its only other use.
| --popover: #1f1c17; | ||
| --popover-line: #342d21; | ||
| --popover: color-mix(in oklab, #1f1c17, #211c12 var(--toward)); | ||
| --popover-line: color-mix(in oklab, #342d21, #4e4432 var(--toward)); |
There was a problem hiding this comment.
[Minor] Hovering a chip in a finding's popover now weakens its outline toward high contrast.
MarkPopover.svelte:309-312 changes the .chip outline from --popover-line to --line-2 on hover. As designed, that's a step from #342d21 to #2e3035, about the same strength. Now that --popover-line moves to #4e4432 and --line-2 stays fixed, hovering at high contrast makes the outline noticeably dimmer, so the hover reads backwards. Hovering to --float-line, or to a brighter mix of --popover-line, would keep it firming up.
There was a problem hiding this comment.
Fixed in f015186: the hover edge is color-mix(in oklab, var(--popover-line), var(--text) 15%), so it's always a step firmer than the resting edge (at 0: #342d21 → #4c453a; at 1: #4e4432 → #665d4c). At 0 it's now warm rather than the old grey, matching the chip's own brown edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts' do Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…browser, with the space it was missing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r than switching to a fixed one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ry buttons, which cut grey blocks into raised surfaces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88fe6a3 to
49ee691
Compare
What
A contrast setting in Settings → Appearance, from "As designed" to "High contrast", kept in this browser. Toward high contrast the page's ground darkens and its three tiers of text brighten. What's raised above the ground (sidebar highlights, cards, menus, popovers, code) keeps its colour, so it stands out more as the ground darkens. The agent browns take a little more colour, their outlines and the edges of neutral popups (menus, popovers, dialogs) firm up, and secondary buttons keep the designed ground as a fill rather than sinking with the page. At "As designed" nothing changes.
Why
The palette is deliberately low in contrast; for some people text and the shapes on the page don't stand out enough. A slider between the designed palette and a high-contrast one lets each person choose how far to go, rather than all or nothing.
How
Only a short list of colours moves, each written as
color-mix()from its designed value toward its high-contrast one by--contrast(0 to 1). An inline script inapp.htmlapplies the stored setting before the first paint, so there's no flash.palette.test.tsworks the palette out fromapp.cssat steps from 0 to 1: each text tier gains contrast and stays readable, nothing raised gets closer to the ground than as designed, and the outlines firm up.Checked: at 0, 33 pages and states are pixel-identical to the branch below; in a browser, the setting follows at once, survives a reload and other pages, and a junk or blocked stored value leaves the page as designed; on a production build the stored setting is in place in the frame before the first paint.
🤖 Generated with Claude Code