excid3 / tailwindcss-stimulus-components

A set of StimulusJS components for TailwindCSS apps similar to Bootstrap JS components.
https://excid3.github.io/tailwindcss-stimulus-components/
MIT License
1.36k stars 137 forks source link

Specify prefix for tailwind classes #201

Closed Vin0uz closed 5 months ago

Vin0uz commented 1 year ago

HeyπŸ‘‹

I've been trying to use components from this beautiful repo in a legacy codebase, which is somewhere in the change from bootstrap to tailwind. To make it safer, tailwind classes are prefixed with tw-

It's safer but it makes the usage of this lib impossible.. or at least not the components I've tried (popover/modal), because tw-hidden stays on, as the lib is dealing with hidden

Do you think there's a way we could explicitly tell components to use a prefix for tailwind classes ? 😬

As a 🩹 I've tried to use custom transition classes, but no luck..

excid3 commented 1 year ago

For a temporary workaround, you can define .hidden { display: none; } which won't conflict with Bootstrap since they use .d-none

Long-term it would be great to have those configurable. πŸ‘

Vin0uz commented 1 year ago

Good one with .hidden πŸ‘Œ

I'll try to give prefix approach a look as well :)