twind icon indicating copy to clipboard operation
twind copied to clipboard

[Bug]: Lit & Dark Mode not usable with "class" mode

Open kadoshms opened this issue 1 year ago • 1 comments

Reproduction

https://lit.dev/playground/#gist=4966b12310c22a412c1cfc2381a6248a

Describe the bug

For systems that enable users to toggle themes (dark/light) - seems like it is not possible to use the "class" mode for darkMode. This makes sense to some extent due to Shadow DOM, I wonder though if we can maybe have some discussion around it and perhaps workaround it. Maybe for a start an update to the documentation is needed + excluding this mode from the allowed modes for web-components.

For "media" based configuration - this works perfectly fine, as the configuration is not derived from a specific selector.

One possible workaround is disabling the Shadow DOM for the element, however this is probably not the best approach, in addition to losing key features such as slots.

Severity

blocking all usage of Twind

System Info

Latest

Additional Information

No response

kadoshms avatar May 30 '24 16:05 kadoshms