Skip to content

Field type collision #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jenstornell opened this issue May 5, 2021 · 1 comment
Closed

Field type collision #70

jenstornell opened this issue May 5, 2021 · 1 comment

Comments

@jenstornell
Copy link

jenstornell commented May 5, 2021

What version of @tailwindcss/forms are you using?

0.3.2

What version of Node.js are you using?

15.0.1

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction repository

Nope

Describe your issue

Tailwind Forms add something like this in the CSS file.

[type='text'] {
}

When using components we can add whatever attributes we want. It may look like this:

<hello-component type="text"></hello-component>

What happends is that in my case I've got a rectangle around my element. That is not expected because this is not an input.

Suggested solution

Add input before type text. No other elements supports type='text' so there is no reason to target all elements here.

input[type='text'] {
}
@adamwathan
Copy link
Member

Hey! Unfortunately this would raise the specificity of the selector and prevent you from overriding the defaults with utility classes. If you have a collision like this I would recommend using the class strategy instead:

https://github.com/tailwindlabs/tailwindcss-forms#using-classes-instead-of-element-selectors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants