saadeghi / daisyui

🌼 🌼 🌼 🌼 🌼  The most popular, free and open-source Tailwind CSS component library
https://daisyui.com
MIT License
33.41k stars 1.27k forks source link

Toggle/checkbox don't change state in winicss #443

Closed xorik closed 2 years ago

xorik commented 2 years ago

Hi.

For some reason it's impossible to enable checkbox/toggle when I use windicss 😞

Here's demo: https://stackblitz.com/edit/vite-tcwtbf?file=index.html

saadeghi commented 2 years ago

Windi is generating invalid style. Expected CSS is:

.toggle:checked,.toggle[checked=true]{
  --chkbg:hsl(var(--bc));
  --tw-bg-opacity:1;
  --tw-border-opacity:1;
  box-shadow:var(--handleoffset) 0 0 2px hsl(var(--b1)) inset, 0 0 0 2px hsl(var(--b1)) inset, var(--focus-shadow);
}

What Windi generates:

toggle, .toggle[checked=true] {
  --chkbg: hsl(var(--bc));
  --tw-bg-opacity: 1;
  --tw-border-opacity: 1;
  box-shadow: var(--handleoffset) 0 0 2px hsl(var(--b1)) inset, 0 0 0 2px hsl(var(--b1)) inset, var(--focus-shadow);
}

I suggest using Tailwind CSS instead of Windi