-
Notifications
You must be signed in to change notification settings - Fork 225
How to remove styles from a particular input? #22
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
Comments
Rather than ignore one, I would like to ignore all and only apply styles to the inputs I choose. I feel like that would be much more in line with the philosophy of tailwind and how |
OK, Seems if you just override them, it plays nicely. For my use cases, I used the following:
Some documentation would have saved me some time though! |
@bcorcoran we shouldn't have to guess all the properties to override though. There should be a way to either mark an input as unstyled or better yet this plugin shouldn't add styles to all inputs, and should instead provide utils we apply to the inputs ourselves, more like how tailwind usually works. |
In principle, I agree; nevertheless I had to find a solution in the meantime. |
@adamwathan how can I help land these changes? I'm quite surprised this plugin takes such an opposite stance to tailwind and styles all inputs. I would expect it to behave like tailwind and only style elements you explicitly add classes to. |
I agree. This feels like a mis-step with the tailwind approach and it's unnecessarily painful to try to disable it for a particular input. |
@adamwathan @RobinMalfait not sure who is in charge of this plugin, but could we get someone to weigh in here? I'm happy to help implement this if there is buy in. |
I was looking through the issues for exactly this! I use plugins like react-select and other JS libraries which uses styled-component and other non-tailwind type css styling options - and this plugin does not play well! 100% agree that adding a simple |
I've made a patch file of #39 for use with patch-package until the PR gets merged. Seems that a lot of people (including me) want this. Thanks @chasegiunta for the PR! Patch file gist: https://gist.github.com/Phixyn/7a2779771b0304be23b9f82e144aedb1 After applying the patch, set
Now you can explicitly use |
We've added the FWIW I don't consider the base style approach to be in conflict with Tailwind at all, in fact to me it feels more correct. Just like we unstyle things like headings and buttons to make them more "styleable" the goal of this plugin is to "reset" the default browser form styles in a way that makes them actually accept utilities gracefully. Put another way, the goal is for this to just work: <input type="checkbox" class="rounded-none"> Without resetting the form styles the way this plugin does, you can't do stuff like that. Adding a class like |
Fair enough. The biggest reason the In an ideal world where everything is consistently designed by the same team it's a non-issue, but in some projects where you don't have the luxury to write your own calendar widget and have to use a third-party one and ship it, it becomes necessary. I appreciate the fact that both strategies are viable now, so thanks. |
Why not offer an opt-out class, like |
Is there a class in tailwinds v3 that I can use to unapply the tailwindscss-forms plugin from one single element on the page? |
I use vue and i'm using a third-party component called vue multiselect.
Is there a way to ignore input elements within a particular selector (i.e., ignore input elements inside a particular class) so that, for example, there isn't a border around the text input?
The text was updated successfully, but these errors were encountered: