-
Notifications
You must be signed in to change notification settings - Fork 12
Fix svgbob diagrams in dark mode #28
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
base: master
Are you sure you want to change the base?
Conversation
mgeisler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I tested it locally and it works great.
|
When I downloaded it, I got and the test failure is with I guess this is because of the |
|
Yes, that seems to be the issue. |
I would suggest making a separate PR that updates the |
|
|
||
| let style = Style::new("svg { width: 100% !important; }").set("type", "text/css"); | ||
| format!("<div style='width:100%; height:{}px;'>{}{}</div>", height, style, source).replace('\n', "") | ||
| format!("<div style='width:100%; height:{}px; fill:var(--fg);'>{}{}</div>", height, style, source).replace('\n', "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that there is a number of configuration options — could it be that we just need to update the default for fill_color?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the default for fill_color does not work for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, thanks for checking! Then I just think you need to rebase this PR on top of master and that will make the tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@boozook, do you know more about or are you fine with just adding the CSS here?
Closes #22
Currently, the SVG text elements receive the default color, black, which is not readable on dark mode.
This PR adds a one-liner CSS fix to apply the foreground css variable (var(--fg)) to the svg text element to make svg text legible and visible.