Giter Club home page Giter Club logo

Comments (3)

adamwathan avatar adamwathan commented on August 15, 2024 1

It's not really that it's ignored, just that we don't have to do anything special to make disabled states styleable. This plugin isn't designed to make forms automatically look good or anything, just make them work more easily with utilities. How you want things to look when they are disabled is hard to generalize, the styles would be different in each project.

The recommended approaches to styling disabled form elements are either:

  1. Just add utilities whenever you add the disabled attribute, usually with JS. Might look something like this:

    <input className={`... ${formDisabled ? 'opacity-50' : ''}`} disabled={formDisabled} />
  2. Use Tailwind's disabled variant (not enabled in Tailwind by default)

    <input class="... disabled:opacity-50" disabled />

No plans to add disabled styles by default as I think that would actually make it harder for people to use custom disabled styles, since they would be forced to enable the disabled variant to defeat the default disabled styles. Hope that makes sense.

from tailwindcss-forms.

robrechtme avatar robrechtme commented on August 15, 2024 1

Thank you for your insights. I didn't know if it was intentional or not, but now that you've told me the reasoning behind it I totally understand.

from tailwindcss-forms.

frederikhors avatar frederikhors commented on August 15, 2024

I can look into making a PR

please

from tailwindcss-forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.