alexbarry / AlexCalc

Scientific calculator with LaTeX equation display, variables, units, complex numbers. Runs locally in your browser with WebAssembly.
Other
18 stars 0 forks source link

Dark mode not Rendering dividing line in '1/sqrt(2)' #2

Closed froh closed 2 years ago

froh commented 2 years ago

Chrome 97.0.4692.98 on pixel 5 on Android 12

Android is set to dark mode.

Chrome flag for dark mode is set to 'default', no render mode selected.

alexbarry commented 2 years ago

Thanks for reporting this! I have found that adding style="color:#000000" to the body element seems to fix this, at least on my phone with that chrome flag enabled.

I don't fully understand this yet. I could implement the above fix now if you'd like, otherwise I'll continue spending some time looking into the ways that browsers handle dark mode. I've also seen the problem go away when adding dark mode meta tags and adding a dark stylesheet, so maybe if I properly handle dark mode then the problem will be fixed in a better way.

froh commented 2 years ago

Do a clean and maintainable fix, I don't need a work around.

alexbarry commented 2 years ago

Thanks again for catching this. I took the time to learn how to properly accommodate switching themes in HTML, added a dropdown to do it, and added a check to determine the user's preference using this method: window.matchMedia("(prefers-color-scheme: dark)").

To my surprise, I ran into two more issues:

I closed this issue because it is now is resolved on my phone and desktop chrome, with the #enable-force-dark flag set. But of course, please re-open it if this doesn't fix the issue for you, I'm happy to keep investigating this.

froh commented 2 years ago

thank you! It works for me now exactly as you describe it. thanks also for sharing your learning experience.