Feat/theming on docs and lib#49
Merged
Merged
Conversation
Adds a "Theming" page under the demo app's docs (nav item + section) covering the theme prop modes, the shared MdmaTheme token shape, custom themes, and the web/RN specifics. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ssmrmmk
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a first-class, opt-in theming system shared across the web and React Native renderers, and makes the demo app fully themeable and mobile-responsive.
Library
themeprop onMdmaDocument(both renderers):"light" | "dark" | "auto"(follows the OS) or a fullMdmaThemetoken object. Omit it for the unchanged default light look — fully backward compatible.styles.cssis now driven by--mdma-*CSS variables; built-in palettes apply viadata-theme, custom themes via inline variables (and are overridable directly in CSS). ExposesMdmaThemeProvider,useMdmaTheme,lightTheme,darkTheme, and helpers. A themelessMdmaDocumentinherits an ancestorMdmaThemeProvider's theme.color-mix.theme="auto"viauseColorScheme(); the built-inlightTheme/darkThemepalettes are unified with the web renderer's so MDMA content looks identical across platforms; fixedTableRenderer/ChartRendererwhose bodies had no themed background (rows showed through on dark).MdmaThemeshape, so a theme object is portable.Demo app
Docs: new
docs/guides/theming.md; README + RN package README updated.Type of Change
Packages Affected
@mobile-reality/mdma-renderer-react@mobile-reality/mdma-renderer-react-native@mobile-reality/mdma-demo) + docsChecklist
pnpm formatandpnpm lintpass).pnpm test).pnpm typecheck).pnpm changeset) if this change affects published packages.sensitive: truewhere appropriate. — N/AHow to Test
pnpm install && pnpm demo, open the demo.react-native-web) uses the same unified palette; try dark mode and the Adoption table example (body themes correctly).<MdmaDocument ast={ast} store={store} theme={myTheme} />(spreadlightTheme/darkThemeand override tokens); or set--mdma-*CSS variables directly.pnpm typecheck && pnpm test && pnpm lint— all green.