Skip to content

fix: mermaid diagrams don't respect dark mode theme #127

Open

Description

@rohilsurana

Problem

`src/components/mdx/mermaid.tsx` initializes mermaid with `theme: 'default'` (line 19), which always renders light-mode diagrams regardless of the site's current theme. In dark mode, diagrams appear as bright white boxes.

Suggested Fix

  • Read the current theme from the document (`document.documentElement.dataset.theme` or the Apsara ThemeProvider context)
  • Initialize mermaid with `theme: 'dark'` when in dark mode
  • Re-render diagrams on theme change (listen for `data-theme` attribute mutations)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions