#Development #Techniques
Passing your CSS theme to ‘canvas’ · How to adapt an HTML ‘canvas’ to user settings https://ilo.im/163mmy
_____
#HtmlCanvas #Themes #LightMode #DarkMode #Browser #WebDev #Frontend #HTML #CSS #JavaScript

Passing Your CSS Theme to `canvas` :: Aaron Gustafson
While working on a recent project I noticed an issue with a canvas-based audio visualization when I toggled between light and dark modes. When I’d originally set it up I was browsing in dark mode and the light visualization stroke showed up perfectly on the dark background, but it was invisible when viewed using the light theme (which I’d neglected to test). I searched around, but didn’t find any articles on easy ways to make canvas respond nicely to user preserences, so I thought I’d share (in brief) how I solved it.