Astro - dynamically adjust favicon
So, I'm just pretty new regarding Astro.
To change my favicon I assume I would need to do:
That is correct, right?
Now, is there a way to dynamically adjust this favicon? Let's say, if user has light theme, use black favicon, and if user has dark theme, use white favicon.
8 Replies
string
, integer
? and boolean
.In this case, there is a much simpler solution 😄
Props wouldn't really help us in this situation anyway, since I don't think we could change them with JS, since the alternative is to use JS to check the user's preference and have it switch out the icon.
Props did help!
Brave (dark theme).
Edge (light theme).
It's dynamically passing the correct favicon :D
Thank you for the help
Ah, combined with props, very nice 🙂