tailwindlabs / tailwindcss-forms

A plugin that provides a basic reset for form styles that makes form elements easy to override with utilities.
https://tailwindcss-forms.vercel.app
MIT License
4.22k stars 223 forks source link

Disable tailwindcss-forms for a specific form #142

Closed timothymctim closed 1 year ago

timothymctim commented 1 year ago

What version of @tailwindcss/forms are you using?

v0.5.4

What version of Node.js are you using?

v18.16.1

What browser are you using?

Firefox

What operating system are you using?

Windows

Reproduction repository

N/A

Describe your issue

Pull request #141 enabled tailwindcss/forms for every input, even if no type is specified. However, this makes it difficult to disable tailwindcss/forms for a specific form or input.

Before v0.5.4 one could just omit type from the input and you were all set. It would be great if one could disable tailwindcss/forms for a specific input, just like tailwindcss/typography allows one to disable prose with not-prose.

A workaround that works currently in (at least) Firefox is to write type="".

adamwathan commented 1 year ago

Hey! Right now the best way to handle this would be to use class strategy documented here:

https://github.com/tailwindlabs/tailwindcss-forms#using-only-global-styles-or-only-classes

...or to simply grab the CSS generated using the previous version of the plugin and paste that directly into your project and remove this plugin (I'd honestly be more likely to take this route myself).

Making it possible to opt-out on a control by control basis is an interesting idea but not a goal right now — the level of complexity we've reached in the typography plugin is pretty regrettable. Sorry that this change breaks your expectations, I don't really want to revert it or anything though because there's never been a way to opt-out of styles for other form controls with the plugin like textarea or select so relying on input with no type to be unstyled doesn't feel consistent to me personally

timothymctim commented 1 year ago

Makes sense! Thanks for the prompt handling of the issue and maintaining the project!