DEV Community

Discussion on: Dynamic Tailwind UI Code with Svelte

Collapse
 
shinokada profile image
shin • Edited

Excellent! This is what I was looking for. Thank you for the post.
Do you know how to change this to Svelte?

:class="{'rotate-180': open, 'rotate-0': !open}"
Enter fullscreen mode Exit fullscreen mode
Collapse
 
dimfeld profile image
Daniel Imfeld • Edited

Glad you liked it! You might also want to check out github.com/rgossiaux/svelte-headle... which is a Svelte port of Tailwind's "Headless UI" component library. I haven't used it myself yet but it looks promising.

And for your question, Svelte's equivalent is this:

<div class:rotate-180={open} class:rotate-0={!open}>
Enter fullscreen mode Exit fullscreen mode