-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bonsai logo text dissappears sometimes in light mode #98
Comments
I can't repro this with Firefox or Edge on Windows, but based on your description this feels like a bug in Chromium. I don't see anything wrong with the way the light/dark mode toggle and CSS is being done. This issue feels somewhat similar, but not exactly the same either: https://issues.chromium.org/issues/349502139 One possible workaround if we don't want to wait and see might be to have two separate images and swap between them instead of using CSS within the SVG. |
Thanks David! Based on your comment I found another trigger prerequisite, seems like this only happens if the user has dark mode enabled for apps in OS settings. Interestingly, I thought there would be an inverse bug (OS light mode, dark theme enabled on website) but it doesn't happen. I also tried loading the page with "disable cache" with chrome devtools and the bug still appears so I no longer think it has to do with cache/loading. I have edited the description and uploaded a video capture. |
Based on David's suggestion, I have raised a PR that switches the logo between light and dark mode, following a solution posted in dotnet/docfx#9386. |
@banchan86 thanks for digging up all these issues, it would definitely be great to converge on a unified strategy. I'm fine with having two versions of each image as our fallback approach, I'm just slightly unhappy that people will get two different URLs when downloading the same image depending on which theme they are in. We also need to change the SVG export scripts, but of course doable. Doing a quick last search for this I came upon an explanation which addresses this and potentially also the dark/white toggles on most mobile browsers: https://www.ctrl.blog/entry/svg-embed-dark-mode.html I haven't tried or examined the linked JS solution yet, but basically if we could implement an easy workaround for Chromium I think we could cover most of our cases for now (we can just choose to deprioritise Safari for now). |
This issue is a chromium bug, but its just isolated to the logo and im fine with the image switching solution just for this image and not implementing it for all SVGs. The other two issues after doing some more digging, it turns out are both Webkit/Safari issues (I thought only 1 was). For #bonsai-rx/docfx-tools#12 which I think is the bigger of the two, Chrome (and all other browser engines) on iOS are forced to use Webkit (outside EU https://www.theverge.com/2024/1/25/24050478/apple-ios-17-4-browser-engines-eu 😛). That unfortunately leaves out non-EU mobile IOS users until we find a Webkit solution. In summary, I guess I am ok with leaving what we have for now and revisiting the issue in the future since it already works for Chromium. |
Describe the bug
When exploring the bonsai-rx main documentation on desktop in light mode, sometimes the logo disappears.
This only happens when theres a page refresh.
It also only happens for certain articles (https://bonsai-rx.org/docs/articles/installation.html, https://bonsai-rx.org/docs/articles/gallery.html, https://bonsai-rx.org/docs/articles/design-guidelines.html). The tutorials and reference section seems to be fine.
It also only happens when user has OS system wide dark mode enabled. Interestingly the bug doesn't happen in reverse (OS light mode, dark theme enabled on website).
Steps to reproduce
Environment
Tested on both Chrome v128.0.6613.119 and Microsoft edge v128.0.2739.63 on windows and Chrome on Mac. Doesn't seem to be present on mobile (IOS).
Cause
@media (prefers-color-scheme: dark)
style tag which changes the text color in light and dark mode, but its erroneously applied in light mode (I have confirmed this by changing the@media (prefers-color-scheme: dark)
text fill to red, and it does appear red in light mode.Priority
Just aesthetically annoying right now, but doesn't have that much of an impact because its triggered in atypical circumstances and is not that important functionally (users still know what site they are on)
Preferred Fix
_appName
attribute ofdocfx.json
. The font can then be styled using a custom CSS style. I would have made a pull request, but I am unable to determine which font was used in the making of the logo.Other solutions tried
Chrome.Bug.in.Light.Theme.with.System.Wide.Dark.Mode.mp4
The text was updated successfully, but these errors were encountered: