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

Browsers' automatic dark mode theme generation breaks svgbob #112

Open
ssokolow opened this issue Apr 28, 2024 · 0 comments
Open

Browsers' automatic dark mode theme generation breaks svgbob #112

ssokolow opened this issue Apr 28, 2024 · 0 comments

Comments

@ssokolow
Copy link

ssokolow commented Apr 28, 2024

I showed a friend a creation of mine which embeds svgbob output in HTML pages, and he was only getting white squares.

It turned out that Firefox's equivalent to this Chrome feature was breaking it by overriding the stroke color from black to white without overriding the fill color from white to black.

(I mention Chrome because I don't know how to test it in Firefox on Linux, but Ungoogled Chromium has "Automatic dark mode" under the paintbrush icon in the DOM explorer's styles pane.)

I was able to get it working for him by adding this to my stylesheet so it would just rely on the underlying background color that the browsers were correctly detecting as something needing to be processed:

/* Fix automatic dark-mode compatibility for svgbob */
.svgbob rect.backdrop, .svgbob .nofill {
    fill: transparent !important;
}

I don't know if there are others that would need to be changed if working that way. That was just the cases that actually got used in my demo diagram.

(And I had to get a workaround promptly because he didn't know how to turn it off. He says it happened automatically in response to modern Windows being in night mode.)

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

No branches or pull requests

1 participant