Spec: Written ahead of the package. Not in 7.0.0-alpha.0: renderWithTheme7.0.0-alpha.0
Theme playground
Edit paper, ink, accent, rule and plate over a real render with the published compileTheme, then copy the Theme object.
import { THEMES, compileTheme, type Theme } from '@mdxui/themes';
const base = THEMES.quaypoint.theme;
…Renders through compileTheme and renderBlock. renderPage takes the five shipped Themes.
How it runs
- The first edit loads
@mdxui/themes, at most 17 KB gzipped, and runscompileThemeon your draft. - The output replaces the frame's
<style data-theme>, which the build wraps around the render's owncompileThemestring. Nothing else in the frame changes. - A field
compileThemerefuses shows its message in place. Clear a color to see the refusal for a missing core role. - Dividers, markers, featured and icons change markup, so they come from the Theme you start from. Policies shows each as two renders.
- The contrast readouts are WCAG 2 ratios of the draft's resolved roles.
Next steps
- Paste the Theme object into
write-a-theme.tsand render a record under it. - Read the Theme contract for every role the draft can set.