Skip to content

Theme default you can switch, exact brand colour steps, seven icons - #246

Merged
lorant-one merged 2 commits into
previewfrom
feat/theme-default-scales-icons
Oct 19, 2026
Merged

lorant-one merged 2 commits into
previewfrom
feat/theme-default-scales-icons

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Requested by Lorant · project thread

Before: a site could not start in light mode and still let visitors switch, because theme: "light" locks the theme. Matching a brand book meant overriding semantic CSS variables with selector hacks. Anything that showed the current theme caused a hydration error (React #418). Arrow-up, menu, people, grid, cube and newspaper icons were missing, and the --font-* variables were declared as themselves.

After: defaultTheme: "light" in style starts visitors on light, and they can still switch. brandScale, accentScale and neutralScale take exact colours per step, in the same shape as the native package. The provider's first render matches the server. The seven icons ship built in, and fonts set by the app always apply.

All of these came from the XESO rebuild test: two agents rebuilt the same app on core 2.2.0, and both lost time on the same workarounds. Details are in /mnt/project-files/xeso/rebuild-test/RESULTS.md.

How:

  • ThemeProvider
    • Starts from propTheme or defaultTheme on both the server and the client.
    • Reads the saved choice in a layout effect.
    • Skips writing data-theme until that sync has happened.
    • Saves "system" when the default isn't "system".
  • ThemeInit: reads defaultTheme and the scales, keeps those keys off <html>, and no longer copies a saved "system" onto data-theme as a literal.
  • customSchemeProperties(seeds, scales): merges a scale over the seed's ramp.
  • Icons: added to the manifest and regenerated.
  • AI rules, spec and bundles, docs and CHANGELOG: updated.
  • Tests: all 3,350 core tests pass, plus 9 new ones in theme-default-and-scale.test.tsx; typecheck is clean.
  • Lint: pnpm lint fails on preview today because of ai/examples/blocks index keys. This PR adds no new lint errors.

Generated by Claude Code

…ven icons; font vars no longer self-reference

Found while two agents rebuilt the XESO front end on core 2.2.0: both
worked around the same gaps.

- defaultTheme on ThemeProvider and ThemeInit: a starting theme the
  visitor can change (theme=light/dark still forces). Choosing System with
  a non-system default is saved so a reload keeps it.
- brandScale/accentScale/neutralScale: exact steps, same shape as native;
  a seed fills the steps a scale leaves out.
- ThemeProvider's first render matches the server; the saved theme is
  applied in a layout effect (no React #418).
- Icons arrowUp, arrowDown, cube, grid, newspaper, people, menu.
- theme.scss no longer declares --font-* as var() of themselves.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CTnFQitvEiLzWCtQz1VgFy
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
core-docs Ignored Ignored Preview Oct 19, 2026 12:32pm UTC

@lorant-one lorant-one self-assigned this Oct 19, 2026
The foundations API-surface tests expect --font-* to stay declared, so
they move to :where(:root) instead of being removed: any app rule wins.
Native ships the same built-in icon names as core.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CTnFQitvEiLzWCtQz1VgFy

Copy link
Copy Markdown
Member Author

The visual check flagged 3 of 798 shots, and I've added the visual-change label for them:

  • /data/setup (2 shots): the chart axis labels now use the app's font. That's the --font-* fix in this PR. Before it, the :root self-reference beat the docs' font variable, and the labels fell back to another font.
  • /modules/chat: a relative day label changed from "Sat" to "Tue". The demo renders a date relative to the capture time; this PR doesn't touch it.

Generated by Claude Code

@lorant-one
lorant-one merged commit 7515970 into preview Oct 19, 2026
13 of 14 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
30 tasks done
@lorant-one lorant-one added the approved label Oct 20, 2026 — with Claude
lorant-one pushed a commit that referenced this pull request Oct 20, 2026
Main's fixes are carried into 3.0's props rather than taken as written:

- Breakpoint show classes only under a wider hide (Flex, Grid), sizes take
  "auto" and "fit", Text and Heading take s={{ hide }} (#226, #245).
- ThemeInit/ThemeProvider: defaultTheme and exact scheme scales beside 3.0's
  density (#246). Kbar's trigger is optional.
- AI harness: main's leaner bundle writer (grouped props, word-list types)
  with 3.0's mixin and key-diff compression; gotchas keep 3.0's wording and
  take main's inRules flags; the app-shell task and app starter, codemodded.
- FileTree follows the state contract: onExpandChange is onExpandedIdsChange
  (codemod entry), onSelectedIdChange is new, onSelect stays the action.
- Main's new native components (#224) take 3.0's props (textVariant,
  aria-label, onValueChange, onPageChange) and point units: their rem
  defaults are written as "Nrem". Native docs pages say points, not rem.
- Effects and Swiper fixes ported to their 3.0 homes (packages/fx,
  Carousel/SnapCarousel).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1
@lorant-one
lorant-one deleted the feat/theme-default-scales-icons branch October 29, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants