-
Notifications
You must be signed in to change notification settings - Fork 9
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 svgbob diagrams in dark mode #28
base: master
Are you sure you want to change the base?
Conversation
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 |
@@ -16,5 +16,5 @@ pub fn bob_handler(s: &str, settings: &Settings) -> String { | |||
svg.render_with_indent(&mut source, 0, true).expect("html render"); | |||
|
|||
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.