Skip to content

website: Fall back to primary.background for themes without selection.background - #3242

Merged
madcodelife merged 1 commit into
mainfrom
website-selection-fallback
Sep 25, 2026
Merged

madcodelife merged 1 commit into
mainfrom
website-selection-fallback

Conversation

@madcodelife

@madcodelife madcodelife commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #3241.

Summary

#3241 mapped the website's --selection token to selection.background, but only 5 of the 36 bundled themes define that key. The other 31 (Catppuccin, Tokyo Night, Gruvbox, Solarized, Ayu, …) dropped the declaration and fell back to the site default, so every such theme selected text in the same #55a0fc blue (light) or #c2610a orange (dark), whatever its own palette.

The token map now accepts an ordered list of sources, and selection resolves to selection.background, then primary.background. That matches the component theme, which falls back to primary when a theme leaves selection.background unset.

Verification

  • bun run build and bun run test:seo pass. The built theme-tokens.css defines --selection for all 36 themes.
  • Headless Chrome on the built /docs/ page with the heading and first paragraph selected. ::selection background:
Theme --selection ::selection alpha
Catppuccin Mocha #89b4fa 0.38
Tokyo Night #7aa2f7 0.38
Gruvbox Dark #d79921 0.38
Ayu Light #55b4d3 0.38
Flexoki Dark (own selection.background) #D0A21577 0.18
Aurora Light (own selection.background) #55A0FC 0.38

…ion.background`

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@madcodelife
madcodelife enabled auto-merge (squash) September 25, 2026 16:10
@madcodelife
madcodelife merged commit 331e3af into main Sep 25, 2026
12 checks passed
@madcodelife
madcodelife deleted the website-selection-fallback branch September 25, 2026 16:17
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