tailwind dark mode reactive logo
i am trying to build a pattern where based on the dark mode setting the logo srcset will change.
using nuxt in universal mode
4 Replies
You might be overcomplicating it for yourself. If you are using tailwind you can have to img tags with one hidden in dark and the other in light. That solves it in pure css
@isakwang how would you define that in CSS?
how would i implement that logic?
<NuxtImg id='light' class='dark:hidden' />
<NuxtImg id='dark' class=' hidden dark:block' />
and then whatever else you do with classes
ok thanks!