Skip to content

fix(theme): dark text and a seed-coloured rest on pale brand seeds (3.1 candidate) - #578

Merged
lorant-one merged 1 commit into
previewfrom
fix/seed-on-solid-contrast
Nov 23, 2026
Merged

lorant-one merged 1 commit into
previewfrom
fix/seed-on-solid-contrast

Conversation

@lorant-one

@lorant-one lorant-one commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

3.1 candidate (plan: /mnt/project-files/3.0/3-1-plan.md).

Problem

Pale brandSeed or accentSeed values had two problems with solid: "color":

  • White text on the solid. The text read at 1.25:1 on #d4f43c, 1.5:1 on a yellow and 1.8:1 on a pale cyan.
  • A dark resting fill. Buttons rested on step 400, which the ramp keeps dark so brand text stays readable on a light page. That turned a lime button olive.

The only workaround was overriding --brand-on-solid-* in custom CSS. Found while building the Databuddy pitch page.

Fix

  • core (customSchemeProperties, in utils/colorScheme.ts): for a brand or accent seed whose white text falls below 2.25:1, it now writes:
    • black on-solid text (medium and weak text come from the scheme's own darkest steps)
    • a resting solid on the seed itself, with the hover a shade darker
  • Pinned scales: a scale that pins 400 or 500 keeps its own solids, and only the text colour changes.
  • What stays white: mid-tones (orange, emerald, sky, #5A93FC, sitting at 2.5 to 3:1), built-in palettes and the neutral scheme are unchanged.
  • foundations:
    • theme.scss's data-solid="color" blocks read the new --function-<s>-solid-* and --function-<s>-on-solid-* keys, falling back to the old steps and white.
    • function.scss maps those keys for custom and sets them to initial on every built-in palette.
  • Theme remaps: SCHEME_STEPS (themeCss) and STEPS (StyleScope) carry the new keys, so per-theme and nested-theme remaps keep them.
  • Token export: it reads the fallback, so once-ui.tokens.json is unchanged for built-ins.

Before / after

These are token-level swatches: resting and hover, dark and light, for six seeds (lime, yellow, cyan, mint, blue, orange).

  • Before: the first four get olive, brown, teal and green rests with white text.
  • After: they rest on the seed with dark text. Blue and orange are identical before and after.

The screenshots are in the project files: databuddy/landing/core-seed-contrast-{before,after}.png.

Checks

  • Core: vitest run passes (341 files, 4,796 tests) and tsc --noEmit is clean. New tests cover:
    • pale seeds get dark text
    • mid and dark seeds keep white
    • neutral is never touched
    • a pinned scale keeps its solids
    • the CSS reads these keys back
  • Foundations: vitest run passes (68 tests):
    • the contrast resolver and token export learned var(--x, fallback)
    • the API-surface snapshot gained the 10 new --function-* names
  • check:tokens and check:utilities are up to date. Biome is clean on the changed lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_016gNJtwouZkoCqJGNXc79pP

A pale brandSeed or accentSeed (a lime, a yellow, a pale cyan or mint) got
white text on its solids (1.25:1 on #d4f43c), and its resting solid sat on
step 400, which the ramp keeps dark, so a lime button turned olive.

customSchemeProperties now writes, for a seed whose white text falls below
2.25:1, black on-solid text, a resting solid on the seed itself and a hover
a shade darker. Foundations reads those keys with the old steps and white
as fallbacks, so built-in palettes and mid-tone seeds are unchanged. A
scale that pins 400 or 500 keeps its solids; only the text follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwouZkoCqJGNXc79pP
@lorant-one
lorant-one merged commit 77be855 into preview Nov 23, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
27 tasks done
@lorant-one lorant-one added the approved label Nov 24, 2026 — with Claude
@lorant-one
lorant-one deleted the fix/seed-on-solid-contrast branch November 29, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants