tailwindcss-forms icon indicating copy to clipboard operation
tailwindcss-forms copied to clipboard

refactor: limit attribute rules to input and select elements

Open meiraleal opened this issue 1 year ago • 4 comments

Currently the rules for styling the inputs are too broad and may conflict with web components that use props named type or mutiple. This PR address this issue by using :where to select only inputs without change the specificity.

meiraleal avatar Jun 11 '24 14:06 meiraleal

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-forms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 7:40pm

vercel[bot] avatar Jun 11 '24 14:06 vercel[bot]

Wrapping an existing portion of a selector in :where(…) will change its specificity but I've fixed them up so that doesn't happen. I think the likelihood of things breaking is probably zero but I think I'd rather be on the safe side here.

thecrypticace avatar Jun 14 '24 19:06 thecrypticace

Honestly I think we should stick with the change from the original commit, where the element selector is bare but the attribute selector is wrapped in :where:

input:where([type=date])

It does reduce the specificity from 0,1,0 to 0,0,1 but I'll take the blame if that breaks anything 🙃 I would've chosen a 0,0,1 selector originally if it were possible anyways.

adamwathan avatar Jun 14 '24 19:06 adamwathan

And this is why I tagged you — I thought there was a chance you might want to.

thecrypticace avatar Jun 14 '24 19:06 thecrypticace

Hey it's been a while since the last comment, any plans to push this forward?

yannickoo avatar Jul 26 '25 22:07 yannickoo