leegao / readme2tex

Renders TeXy Math for Github Readmes
MIT License
904 stars 194 forks source link

Dark theme issues #45

Open jeremy-rifkin opened 2 years ago

jeremy-rifkin commented 2 years ago

I recognize this is a challenging problem to resolve but rendered formulas are invisible in dark mode:

image

jeremy-rifkin commented 2 years ago

Is it possible to add a white background to rendered formulas? Not an ideal solution, but better than invisible. Alternatively, would a white outline to text look decent?

rishigoutam commented 2 years ago

Would creating two SVGs work? One for dark mode and one for light mode. And then specifying the theme context as per https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/

This works for images in READMEs, so I imagine toggling which SVG is shown might work.

(If anyone knows how to create a dark-mode SVG from the SVG readme2tex creates, I would appreciate that too)