Skip to content

feat: add a ThemePanel debug component - #168

Open
abernier wants to merge 2 commits into
mainfrom
feat/theme-panel
Open

abernier wants to merge 2 commits into
mainfrom
feat/theme-panel

Conversation

@abernier

@abernier abernier commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Adds a ThemePanel component to material-theme-builder/react — a drop-in debug panel (à la Radix Themes' ThemePanel) for tweaking the MCU theme live: source color, per-palette overrides, custom colors, scheme variant and contrast level.

import { Mtb, ThemePanel } from "material-theme-builder/react";

<Mtb source="#769CDF">
  <ThemePanel />
</Mtb>;
  • Ported from the sizematters app's ColorPalettePanel, stripped of its app-specific machinery (react-intl, image-derived palette, localStorage cache).
  • Theme application is debounced (50ms): dragging a color input fires on every frame and each application rebuilds the whole theme.
  • The Flowfield story now renders <ThemePanel /> in place of its ~200-line inline palette overlay.
  • README: new ThemePanel section.

Note: styles are Tailwind classes bundled in the JS — consumers must let their Tailwind scan the package (e.g. @source "../node_modules/material-theme-builder/dist";), same constraint as ExportButton.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PyTbaYR8iH4e7ehPYpeQgX

abernier and others added 2 commits August 3, 2026 13:38
Ported from the sizematters app's ColorPalettePanel, stripped of its
app-specific machinery (react-intl, image-derived palette, localStorage).
Drives the theme through useMcu: source color, palette overrides,
custom colors, scheme variant and contrast level — debounced so dragging
a color input doesn't rebuild the theme every frame.

The Flowfield story now uses it in place of its inline palette overlay.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PyTbaYR8iH4e7ehPYpeQgX
ThemePanel now imports useMtb / MtbConfig (the renamed names), and the
Flowfield story helpers keep the ThemePanel replacement on top of the
rename.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PyTbaYR8iH4e7ehPYpeQgX

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant