Skip to content

Custom initialization based on media preferences #23

Closed
@kratsg

Description

@kratsg

It would be great if this mermaidJS plugin could support allowing for a custom initialize block with mkdocs - as mkdocs-material (for example) supports a "preferences" which allows one to automatically switch between light/dark theme. A similar effect can be done with something like

mermaid.initialize({
    theme: (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) ? 'dark' : 'light'
 });

but how does one override the injection of this JS and provide your own?

Metadata

Metadata

Assignees

No one assigned

    Labels

    mkdocs-materialThis issue is connected with the mkdocs-material APIresolvedThe question was resolveduseful tipContains a useful tip to solve the issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions