-
Notifications
You must be signed in to change notification settings - Fork 225
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
Generate both global styles and classes by default #71
Generate both global styles and classes by default #71
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tailwindlabs/tailwindcss-forms/4q1VpDwEJt6aRC9tX9GUekkZcQxa |
Hey! Can you explain the use case for this? If |
Hey, sure. I really like the approach of covering base inputs out of the box, without the classes. But having a few edge cases where classes would help. Have had to style some non-input elements to match inputs as placeholders (aren't just disabled inputs). Also targeting form elements out of our direct control say from other libraries is handy if can inject the classes. (To style stripe elements it would be great if |
I find this helpful too for my current project. I want the default behaviour but there are some edge cases where I would have to add the styling manually. I am currently integrating TipTap editor and I want to make it look like a textarea. I'd be so convenient to have the Just like @sanscheese says, sometimes is also useful to style other HTML components as placeholders. |
Just tested and this does the trick:
But not sure if this it's messing up too much... |
A better example of this. Ideally, an app may want to use the |
Just a +1 to say this would indeed be useful with Stripe Elements. Stripe Elements inserts the inputs dynamically, inside |
Thanks for the helpful feedback, definitely convinced that it makes sense to support this! The main thing I'm undecided on is the API — just don't love Some ideas:
I think I do like the idea of both the base rules and the classes being available right out of the box without any extra configuration personally. Any thoughts or opinions? |
@adamwathan I do like the idea of having both available right out of the box, I guess is a pretty common use case to use components from third party libraries which you probably want to style just as the rest of your form components. |
@adamwathan my suggestion here would be a combo of options 1 and 2.
That way we support both out of the box, we have an idea for future expansion (should we ever need one — not sure if we will), and we don't affect any users who have their strategy explicitly set. Thoughts? |
@thecrypticace I like this idea — where the Meaning for anyone who has the strategy explicitly set right now, nothing will change. However, for anyone who doesn't have it set will now have the option to use the My only concern is this: Is anyone relying on the default strategy ( |
@reinink Yep, I thought about that explicitly while I was thinking through my idea. The intent was to reduce the possibility of breakage while giving a better out-of-the-box experience. I think doing this and releasing it as v0.5.0 is the right call. |
I agree with the thoughts above. I've made initial changes for this, but still just using the single string value. I'm wondering if |
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
This is closer to the wording we use in the readme
…s-forms into feat/strategy-both
Thanks @sanscheese! 🎉 |
Porque no los dos?