Skip to content

Introduce dark mode: support plugins#43

Open
sistrall wants to merge 2 commits intomasterfrom
feat/semantic-tokens-for-colors
Open

Introduce dark mode: support plugins#43
sistrall wants to merge 2 commits intomasterfrom
feat/semantic-tokens-for-colors

Conversation

@sistrall
Copy link
Copy Markdown
Contributor

Adds a semanticColorTokensTheme field to the plugin SDK context, with a typed list of known tokens (surface/ink/border, plus per-context variants for primary/tinted/accent/selected/disabled/danger/highlight/etc., plus diff/status/overlay/stacked/progress/tooltip/code/shadow groups). The Theme field is preserved but marked deprecated for backward compat.

generateStyleFromCtx now emits these tokens as CSS custom properties (--color--surface, --color--primary--ink, etc.) on the Canvas root.

All react-ui components are migrated to consume the new tokens (Button, ButtonGroup, Dropdown, Section, TextInput, TextareaInput, SwitchInput, SidebarPanel, Toolbar, Tooltip, VerticalSplit, …).

For backward compatibility, the legacy color vars in Canvas/styles.module.css (--border-color, --base-body-color, --alert-color, --add-color, …) now resolve to the closest semantic token first, falling back to their original light-mode RGB values. The color block is marked @deprecated and slated for removal in a future major; spacing/font/easing tokens remain stable. --spacing-xs is added to complete the spacing scale.

Other touch-ups:

  • fill="currentColor" on every shipped SVG icon so colors inherit
  • SidebarPanel uses CaretDown/Up icons (matching the CMS)
  • SwitchInput styles brought in line with the CMS (off-track ink-muted, primary--ink/surface for checked, smoother knob transitions)
  • Fix broken var(--border-radius-m) reference in TooltipDelayGroup JSDoc example

@sistrall sistrall self-assigned this Apr 21, 2026
Adds a `semanticColorTokensTheme` field to the plugin SDK context, with a
typed list of known tokens (surface/ink/border, plus per-context variants
for primary/tinted/accent/selected/disabled/danger/highlight/etc., plus
diff/status/overlay/stacked/progress/tooltip/code/shadow groups). The
`Theme` field is preserved but marked deprecated for backward compat.

`generateStyleFromCtx` now emits these tokens as CSS custom properties
(`--color--surface`, `--color--primary--ink`, etc.) on the Canvas root.

All react-ui components are migrated to consume the new tokens
(Button, ButtonGroup, Dropdown, Section, TextInput, TextareaInput,
SwitchInput, SidebarPanel, Toolbar, Tooltip, VerticalSplit, …).

For backward compatibility, the legacy color vars in
`Canvas/styles.module.css` (`--border-color`, `--base-body-color`,
`--alert-color`, `--add-color`, …) now resolve to the closest semantic
token first, falling back to their original light-mode RGB values. The
color block is marked `@deprecated` and slated for removal in a future
major; spacing/font/easing tokens remain stable. `--spacing-xs` is added
to complete the spacing scale.

Other touch-ups:
- `fill="currentColor"` on every shipped SVG icon so colors inherit
- SidebarPanel uses CaretDown/Up icons (matching the CMS)
- SwitchInput styles brought in line with the CMS (off-track ink-muted,
  primary--ink/surface for checked, smoother knob transitions)
- Fix broken `var(--border-radius-m)` reference in TooltipDelayGroup
  JSDoc example
@sistrall sistrall force-pushed the feat/semantic-tokens-for-colors branch from 4caa4db to eeebc6f Compare April 21, 2026 16:47
@sistrall sistrall force-pushed the feat/semantic-tokens-for-colors branch from 01c4633 to daa8770 Compare April 22, 2026 13:06
@sistrall sistrall changed the title feat: introduce semantic color tokens and migrate react-ui to them Introduce dark mode: support plugins Apr 22, 2026
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