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
How to customize in tailwind.config.js #33
Comments
Hi, |
Hi, |
Hi, As the plugin is now, it looks like we are limited to customizing directly in the element's class, or creating a css file and importing it as a component of our tailwind.css. Example: In order to be able to customize directly by tailwind.config.js it would be necessary to change to: But as I mentioned earlier, it can be customized by a css file. forms.css Note that I added input to the selector this is to work because of the css Precedence order. If it were a selector without the input, the style would not work. And to the tailwind.css For more info what selector you need to change, see the source. |
Hey! The recommended way to customize things using this plugin is to just write CSS. Act like the styles in this plugin are just part of Normalize/Preflight, and layer on any additional custom base styles you want to tweak the default styles 👍 @layer base {
[type="text"],
[type="email"]
/* ... */ {
border-color: pink;
}
/* ... */
} Hope that helps! |
We're using the official Tailwind forms plugin now. These "base form" styles will add onto what Tailwind gives us, the idea is that these styles will get applied globally. If we need to add further customizations (not globally) then they should be in another stylesheet related to where it's being used, if that makes sense. Only global form style changes should go in here. For reference, following the pattern here: tailwindlabs/tailwindcss-forms#33 (comment) Refs: #3128
We're using the official Tailwind forms plugin now. These "base form" styles will add onto what Tailwind gives us, the idea is that these styles will get applied globally. If we need to add further customizations (not globally) then they should be in another stylesheet related to where it's being used, if that makes sense. Only global form style changes should go in here. For reference, following the pattern here: tailwindlabs/tailwindcss-forms#33 (comment) Refs: #3128
We're using the official Tailwind forms plugin now. These "base form" styles will add onto what Tailwind gives us, the idea is that these styles will get applied globally. If we need to add further customizations (not globally) then they should be in another stylesheet related to where it's being used, if that makes sense. Only global form style changes should go in here. For reference, following the pattern here: tailwindlabs/tailwindcss-forms#33 (comment) Refs: #3128
My solution was just to copy the plugin into my own project and then remove all the hard coded references. Not great. I don't like the idea of mixing tailwind and plain CSS just for this, when I've not had to add any custom CSS for any other reason. |
Hi,
how to customize borders (width, colors, ...) of inputs with tailwind.config.js ?
Best regards
The text was updated successfully, but these errors were encountered: