Skip to content

fix(mermaid): support native theme and font defaults - #730

Merged
farnabaz merged 2 commits into
vercel:mainfrom
DeepanB15:fix/mermaid-native-defaults
Nov 13, 2026
Merged

farnabaz merged 2 commits into
vercel:mainfrom
DeepanB15:fix/mermaid-native-defaults

Conversation

@DeepanB15

Copy link
Copy Markdown
Contributor

Description

Adds an opt-in useMermaidDefaults option to createMermaidPlugin, allowing users to use Mermaid's native theme and font defaults instead of the plugin-provided defaults.

The existing theme (default) and font (monospace) settings remain unchanged by default to ensure backward compatibility.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Related Issues

Fixes #714

Changes Made

  • Added useMermaidDefaults?: boolean to MermaidPluginOptions.
  • Made theme and font defaults conditional on the useMermaidDefaults option.
  • Preserved existing plugin defaults when the option is not enabled.
  • Allowed explicit theme and font configuration through options.config and getMermaid().
  • Added four tests covering backward compatibility, native defaults, and configuration overrides.
  • Updated Mermaid plugin documentation with usage examples.
  • Added a patch changeset.

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

Test Coverage

  • Mermaid package tests: 18/18 passed.
  • Biome checks passed.
  • TypeScript exact-optional check passed.
  • Package build successful.

Screenshots/Demos

Not applicable. This change affects Mermaid configuration behavior and does not introduce visual UI changes.

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have created a changeset (pnpm changeset)
  • All my commits are signed

Changeset

  • I have created a changeset for these changes

Additional Notes

The option is opt-in, so existing users will continue to receive the plugin's current theme and font defaults. When enabled, Mermaid's native defaults apply unless explicitly overridden by the user.

@vercel

vercel Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

@DeepanB15 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ All commits are signed

All 2 commit(s) in this pull request have a verified signature. Thanks!

Checked at 70fcb83.

@DeepanB15
DeepanB15 force-pushed the fix/mermaid-native-defaults branch from f735d02 to 2cf60a4 Compare November 12, 2026 07:33
@DeepanB15

Copy link
Copy Markdown
Contributor Author

Thanks! I've updated the commit with a verified SSH signature, and the signed-commit verification is now passing.

The implementation and tests are ready for review. Please let me know if any changes are needed.

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks

@farnabaz
farnabaz merged commit db1a468 into vercel:main Nov 13, 2026
8 of 9 checks passed
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.

@streamdown/mermaid: plugin defaults override Mermaid's own theme and font

2 participants