Skip to content

Commit

Permalink
Allow for <input> without type (#141)
Browse files Browse the repository at this point in the history
* Allow for <input> without `type`

* Remove note in readme

* Add element to selector

* Use :where
  • Loading branch information
karlhorky committed Jul 13, 2023
1 parent 73d5b01 commit c846b72
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -51,8 +51,6 @@ Currently we add basic utility-friendly form styles for the following form eleme
- `select[multiple]`
- `textarea`

**Note that for text inputs, you must add the `type="text"` attribute for these styles to take effect.** This is a necessary trade-off to avoid relying on the overly greedy `input` selector and unintentionally styling elements we don't have solutions for yet, like `input[type="range"]` for example.

Every element has been normalized/reset to a simple visually consistent style that is easy to customize with utilities, even elements like `<select>` or `<input type="checkbox">` that normally need to be reset with `appearance: none` and customized using custom CSS:

```html
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Expand Up @@ -17,6 +17,7 @@ const forms = plugin.withOptions(function (options = { strategy: undefined }) {
{
base: [
"[type='text']",
"input:where(:not([type]))",
"[type='email']",
"[type='url']",
"[type='password']",
Expand Down

1 comment on commit c846b72

@vercel
Copy link

@vercel vercel bot commented on c846b72 Jul 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.