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 markdown-generated SVG issues on dark mode #509

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

EmNudge
Copy link
Contributor

@EmNudge EmNudge commented Mar 18, 2024

The markdown currently makes use of mermaid diagrams and SVGBob outputs.

Unfortunately:

  • SVGBob is not theme-aware
  • Mermaid diagrams are hard-coded for light mode
  • SVGBob leaks all its styles to other SVGs (the header)

We might want to consider an astro plugin to change SVGBob's generated styles, but this fix should be simple enough to suffice for now.

Before After
Buffer Before Buffer After
Header Before Header After
Mermaid Before Mermaid After
Mermaid Seq Before Mermaid Seq After

@EmNudge
Copy link
Contributor Author

EmNudge commented Mar 18, 2024

Addresses problem in #506

@EmNudge
Copy link
Contributor Author

EmNudge commented Mar 19, 2024

We may also consider now bumping remark-svgbob. I upstreamed a fix for the wasm build that landed today. This doesn't affect the Mermaid diagram situation, so we should probably do this in a follow up PR.

@kdheepak
Copy link
Contributor

I wonder if there's a css fix for mermaid rendering the text properly:

313538928-b0675220-e5b5-49dc-99e0-be913ba8beea

But this PR looks great! I'm going to go ahead and merge it.

@kdheepak kdheepak merged commit c71fd39 into ratatui:main Mar 19, 2024
6 of 7 checks passed
@EmNudge
Copy link
Contributor Author

EmNudge commented Mar 21, 2024

I wonder if there's a css fix for mermaid rendering the text properly:
[image]
But this PR looks great! I'm going to go ahead and merge it.

This is mostly due to the font size not being connected to the pre-chosen mermaid boxes. We can probably add a css fix for this as well. I can follow up on this.

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