-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature Request: Config Option to compliment state selectors #970
Comments
The issue doesn't seem to be assigned to me, please help 🙏 |
Thank you for contribution. For example we can add both selectors in daisyUI: .toggle:checked,
.toggle-checked{
} And it allows us to have a custom element that looks like a checked checkbox. I think this is simpler and less confusing than having a exclusive config object for it. |
Thanks for the fast reply! Edit: I really liked(❤️) how clean the CSS code was when I looked and it and even tho it's just adding one state class now it might become a slippery slope. |
I don't have experience working with Radix. Can you please tell me how you use daisyUI classes in Radix and what exactly is the issue? Because we can add anything to daisyUI source code [to integrate with other libraries] as CSS selectors and if people are not using them, unused selectors will be purged in production. |
I created a sandbox, easier than explaining the base usage 😄 https://codesandbox.io/s/determined-goldstine-oqgcne?file=/App.js The |
Thank you! So, all it takes is to add other components that need this addition would be |
I did even think of that, really good idea 👌 Feels like the correct solution. Let me know if you need any help! |
I will fix it today. Thank you 🙌 |
Does this work with <form className="group">
<button className="btn group-focus-within:btn-primary group-focus-within:text-primary-content" />
</form> |
Feature request
This issue is a request to add an option in the DaisyUI config that allows complementing the pseudo-classes that control the state (e.g. :checked) of a component with any selector of choice.
Rationale
I tried to use DaisyUI together with radix UI and for the most part, it works great. The way radix is handling the state of its components is through data attributes like
[data-state]
and that's where it became an issue for certain components like Toggle. I like that daisy is "locked" to write a checkbox as an actual checkbox but it would be nice to be able to opt-in to handle the state with javascript.Proposed Implementation
Please look at the pull request linked to this issue for details.
When writing the code (and this issue) I had a look at how the prefix option was implemented and tried to follow the same patterns. I think some optimizations can be made in the way the configuration is read since they are very similar.
The text was updated successfully, but these errors were encountered: