themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.29k stars 708 forks source link

Style based on dropdown state #895

Closed MangoMarcus closed 2 weeks ago

MangoMarcus commented 2 weeks ago

I'd like to style based on the dropdown's state, specifically to rotate the arrow icon when it's open.

Preline provides a hs-dropdown-open modifier, eg. hs-dropdown-open:rotate-180. This also allow you to animate properties like opacity or margin-top when the dropdown is opened.

A simpler solution could just be to add an open class to the data-dropdown-toggle element, then you can use TW's group feature to achieve the same effect - eg. group-[.open]:rotate-180

Thanks

zoltanszogyenyi commented 2 weeks ago

Hey @MangoMarcus,

Thanks for the suggestion - we have an animation update stored for Flowbite in the future and this will be a part of it.

Cheers, Zoltan

MangoMarcus commented 2 weeks ago

Thanks @zoltanszogyenyi , feel free to close this then 🙂