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

Generate SVG work for both light and dark theme #6

Open
miloyip opened this issue Jul 28, 2022 · 1 comment
Open

Generate SVG work for both light and dark theme #6

miloyip opened this issue Jul 28, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@miloyip
Copy link

miloyip commented Jul 28, 2022

Currently the output SVG grpahics has white background and black lines/text.
They look a bit odd in a dark theme rustdoc.
Hope it can use some style class of the HTML to make it fit for light and dark theme.
I am not very familiar with HTML/CSS/SVG, not sure if this is possible.

@yvt
Copy link
Owner

yvt commented Aug 19, 2022

I absolutely agree! The trick I use in R3-OS is to detect theme changes in JavaScript code and set afilter CSS property on dark themes.

I just found that rustdoc now sets a data-theme attribute on the root element (implemented by rust-lang/rust#91062, I think), which we can reliably match by CSS rules. Maybe we could inject the necessary CSS rules to apply appropriate styling, but the exact way of doing this and whether svgbobdoc should do this is up to discussion.

@yvt yvt added enhancement New feature or request help wanted Extra attention is needed labels Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants