Freelance digital designer & web developer from the United Kingdom with over 10 years of experience. Admin at the webwide.io forums. Curates all the best web design & development tools at hoard.fyi.
Are there operating systems that have a dark mode with common browsers that don't have support for prefers-color-scheme? 🤔 Seems like it would be such a minority that it's not worth loading the JS for such a small enhancement. Only IE11 on Windows 10 it seems like.
As I've mentioned in my comment above - you don't have to go down the JS route.
However, the reason why I've chosen this way - is because the favicon automatically updates when you switch themes, which makes for a very good user interface.
It's your choice, but I'd prefer the three lines of code over messing with the SVG code 😅
favicon automatically updates when you switch themes
@johnletey, when you say this - does it mean the favicon updates without the user having to reload the page? If yes, then that would mean that it needs JavaScript to listen to theme change events. Genuinely curious.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Are there operating systems that have a dark mode with common browsers that don't have support for prefers-color-scheme? 🤔 Seems like it would be such a minority that it's not worth loading the JS for such a small enhancement. Only IE11 on Windows 10 it seems like.
As I've mentioned in my comment above - you don't have to go down the JS route.
However, the reason why I've chosen this way - is because the favicon automatically updates when you switch themes, which makes for a very good user interface.
It's your choice, but I'd prefer the three lines of code over messing with the SVG code 😅
I like that (media query embedded in the SVG CSS)
@johnletey, when you say this - does it mean the favicon updates without the user having to reload the page? If yes, then that would mean that it needs JavaScript to listen to theme change events. Genuinely curious.