I'm gonna prefix this with I don't think my way is the only way to do this.
This way works for me - and it's very simple.
As you've mentioned, you can just put the media tag inside the SVG code of your favicon.
But of what I've seen with this - it doesn't automatically switch, and you have to reload
The reason why I love this solution is because it's automatic as soon as you toggle themes.
If you are interested in going down the SVG route - I'd suggest you look here.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
I'm gonna prefix this with I don't think my way is the only way to do this.
This way works for me - and it's very simple.
As you've mentioned, you can just put the media tag inside the SVG code of your favicon.
But of what I've seen with this - it doesn't automatically switch, and you have to reload
The reason why I love this solution is because it's automatic as soon as you toggle themes.
If you are interested in going down the SVG route - I'd suggest you look here.