Tailwind Tip #5 ✨ You can use ":invalid" pseudo class to create a pure css Tailwind CSS form…
@surjithctly1万 位关注者
169,318 次观看
10 条评论
评论来自 X (Twitter) 上的原帖

@surjithctly
Join my personal newsletter ↓
2 个赞

@surjithctly
💡You might want to remove "novalidate" from the <form> so that users cannot submit using keyboard "tab"
4 个赞

@surjithctly
💡 You can also add the invalid class as a custom variant to declutter your html. Here's the updated version:
25 个赞

@dominikgeimer
@tailwindcss Really like your tips! Keep going!
2 个赞

@surjithctly
@tailwindcss Thanks Dominik!

@jvpdesignllc
@tailwindcss Holy hell, that's a lot of modifiers. There's got to be a better way than something like `[&:not(:placeholder-shown):not(:focus):invalid~span]:block`
2 个赞

@surjithctly
@tailwindcss you can simplify it using tailwind-config by creating custom variants. See ↓
4 个赞

@KhanifDev
@tailwindcss for simple validation its ok, but for complex validation you have to use javascript
2 个赞

@surjithctly
@tailwindcss Yes + server side validation is a must.
2 个赞

@Segayi_Andrew
@tailwindcss Hey man really waited for the dribble page I shared to be put to life
1 个赞