Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add dark mode for diagrams (#1213) #1627

Merged
merged 1 commit into from
Jan 15, 2024
Merged

fix: add dark mode for diagrams (#1213) #1627

merged 1 commit into from
Jan 15, 2024

Conversation

iverly
Copy link
Contributor

@iverly iverly commented Jan 15, 2024

This pull request adds the dark mode theme for mermaid diagrams that match the selected theme.

Related Issue or Design Document

#1213

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

This fix only applies after a page refresh if the page has a diagram. This is due to the mermaid package refreshing it empty (and I don't know why).

We can open a new issue to fix this bug later, while still keeping diagrams more visible than today.

This commit adds the dark mode theme for mermaid diagrams that match the selected theme.

Close #1213

Signed-off-by: iverly <[email protected]>
Copy link
Member

@vinckr vinckr left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contribution!
This fixes our issues with darkmode diagrams 🎉

It works great when I have dark mode enabled on the docs and then navigate to a page that has a mermaid diagram.
One thing that is still not fixed it seems:
If I am already on the page (for example this one) and then toggle dark mode, its the old unfixed version. A page refresh F5 fixes the diagram, but that might not be obvious to users)

Still this is a 90% fix IMO, thanks again 👍

@zepatrik zepatrik merged commit c013a05 into ory:master Jan 15, 2024
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.

3 participants