-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple targets with different classes? #108
Comments
Hi @jlahijani, That's exactly that, yes. Multiple targets must use the same set of classes to toggle. |
Thanks for the reply @Twikito. The use case I had was the following. Right now with TailwindUI, many of the sections require JavaScript. TailwindUI has 3 options for these sections that require JavaScript:
Easy Toggle State is actually a nice fit for many of the sections and could be the "use your own JavaScript" approach. While experimenting, I came across a section that utilized an accordion. It's the first one on this page (but you won't be able to see the interactive example unless you have a paid account): Anyway, when an accordion item is clicked, it must open the corresponding panel AND also apply a different CSS class to the item arrow to indicate an active state. So, one trigger targets two different elements each with their own classes. Easy Toggle State's accordion example circumvents this with some clever SCSS but with Tailwind, it's all about toggling classes themselves. One thought I had is something like this (notice the commas):
Does this sound reasonable? |
Well, this is interesting actually. The problem here is that the target defined by The only way I see could be to enhance the selection and the class list to a be able to specify a table, sush as
Seems doable, right? |
That looks like a great approach. So ... meaning it's optional shortcut of doing:
Therefore I think it would be fine to keep |
Hey @jlahijani 👋 I thought a bit more on that request, and I think that to avoid any behaviour conflict, I'll create a new property, such as
What do you think? |
Sounds good to me. |
I understand that multiple targets can be assigned, but can multiple targets have their own set of classes be toggled as well? Right now it seems the multiple targets must use the same classes.
The text was updated successfully, but these errors were encountered: