Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Tailwind Tip #5 ✨ You can use ":invalid" pseudo class to create a pure css Tailwind CSS form validation without javascript. View code 👇 (5/30) follow for 25 more tips 😊

169,272 görüntüleme • 3 yıl önce •via X (Twitter)

10 Yorum

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

Join my personal newsletter ↓

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

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

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

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

Dominik Geimer profil fotoğrafı
Dominik Geimer3 yıl önce

@tailwindcss Really like your tips! Keep going!

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

@tailwindcss Thanks Dominik!

jeff pohlmeyer profil fotoğrafı
jeff pohlmeyer3 yıl önce

@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`

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

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

Khanif Ikhsanudin profil fotoğrafı
Khanif Ikhsanudin3 yıl önce

@tailwindcss for simple validation its ok, but for complex validation you have to use javascript

Surjith S M ✪ profil fotoğrafı
Surjith S M ✪3 yıl önce

@tailwindcss Yes + server side validation is a must.

#RelaxedGuy🇺🇬 profil fotoğrafı
#RelaxedGuy🇺🇬3 yıl önce

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

Benzer Videolar