Skip to content

input should always default to [type='text'] styling. #127

Closed
@synchronizing

Description

@synchronizing

What version of Tailwind CSS are you using?

v3.1.8

What build tool (or framework if it abstracts the build tool) are you using?

Using it with django-tailwind and django-minify-html. Under the hood Django Minify uses minify-html.

What version of Node.js are you using?

v18.7.0

What browser are you using?

Chrome

What operating system are you using?

MacOS

Reproduction URL

N/A

Describe your issue

Minify HTML replaces all <input type="text" ...> with simply <input ...> since input's default style should always be text.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
How an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. If this attribute is not specified, the default type adopted is text.

https://www.w3.org/TR/html401/interact/forms.html
This attribute specifies the type of control to create. The default value for this attribute is "text".

As it currently sits, Tailwind does not default this when generating the style sheet for input. Instead, it generates the following:

[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
...
}

input should be included in the above styling.

input,[type='text'],[type='email'],...

If this is not possible, is there any way to create a plugin in the tailwind.config.js file to append input to the style mentioned above? Thanks!


Relates to minify-html#95.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions