Skip to content

Fix disabled addVariant call in Tailwind config #2268

@david-crespo

Description

@david-crespo

@charliepark and I just noticed that this line is not behaving as designed. The comma-separated string thing doesn't seem to be valid for Tailwind, so it is just taking the first one, failing to style disabled inputs. We haven't looked into the scope of this, but I expect fixing it will require at least one or two fixes where we were relying on broken behavior, so we want to do this in a separate PR from #2267 where we noticed this.

addVariant('disabled', '&.visually-disabled, &:disabled')

To get the logical OR behavior we want, we need to do this:

addVariant('disabled', ['&.visually-disabled', '&:disabled'])

(To get logical AND behavior you would put them in the same selector, like &.visually-disabled:disabled.)

I confirmed what the behavior is in the Tailwind playground:

https://play.tailwindcss.com/BZ5FK84yVE?file=config

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions