Skip to content

Remint theme color pairings from --{name}-base - #42947

Draft
mdo wants to merge 2 commits into
mainfrom
theme-remint-tokens
Draft

mdo wants to merge 2 commits into
mainfrom
theme-remint-tokens

Conversation

@mdo

@mdo mdo commented Sep 25, 2026

Copy link
Copy Markdown
Member

Stacked on #42929. Review and merge that first; this builds on it.

  • Rebuild $theme-colors through a new theme-color() helper so each pairing (fg, fg-emphasis, bg-subtle, bg-muted, border, focus-ring) derives from var(--{name}-base) with color-mix, instead of referencing fixed palette stops like --blue-600.
  • Add color-stop() and theme-blend() to scss/_colors.scss and theme-pair() to scss/_theme.scss to replay the palette tint/shade recipe against the base.
  • base still anchors to the palette 500; inverse and secondary stay hand-authored. Default compiled colors are unchanged (exact parity).
  • One :root { --bs-primary-base: … } override now re-mints the whole set. Add a Root option to the token playground to show this next to Base and All.
  • Document the derivation, the :root-vs-subtree cascade limit, and single-token overrides in customize/theme.mdx.

Note: reminting from one variable works at :root. For a subtree, CSS resolves the derived tokens where they are declared, so users restate the tints/shades they need.

Supersedes the hardcoded pairings.

mdo added 2 commits September 13, 2026 12:44
Show how theme and layout tokens flow to components. Readers change the
radius, spacer, or primary color and see the button, input, alert, and
card update together. The Remint control demonstrates how derived tokens
(bg-subtle, fg, border) restate the theme today.
Rebuild $theme-colors through a new theme-color() helper so every pairing
(fg, bg-subtle, border, focus-ring, …) derives from var(--{name}-base) with
color-mix, instead of pointing at fixed palette stops. Add color-stop() and
theme-blend() in _colors.scss and theme-pair() in _theme.scss to replay the
palette recipe against the base. Default compiled colors are unchanged.

One :root override of --bs-{name}-base now re-mints the whole set. Add a
Root option to the token playground to demonstrate this, and document the
mechanism, the cascade scope limits, and single-token overrides in theme.mdx.
@mdo mdo added docs Documentation site and its content css Sass sources or compiled CSS v6 v6, the main branch labels Sep 25, 2026
@mdo mdo added this to v6.0.0 Sep 25, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in v6.0.0 Sep 25, 2026
Base automatically changed from token-playground-docs to v6-dev September 29, 2026 05:00
@julien-deramond julien-deramond added feature New feature, or a change to how an existing one works has-conflicts Conflicts with its base branch: needs a rebase labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css Sass sources or compiled CSS docs Documentation site and its content feature New feature, or a change to how an existing one works has-conflicts Conflicts with its base branch: needs a rebase v6 v6, the main branch

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants