Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Suuuper handy new CSS: :user-invalid and :user-valid pseudo selectors let you style inputs only once they have been interacted with Just landed in Chrome + Safari, been in Firefox for years.

177,399 Aufrufe • vor 2 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Gordon Shumway
Gordon Shumwayvor 2 Jahren

This is great! I had to use JS to achieve same functionality multiple times.

Profilbild von Wes Bos
Wes Bosvor 2 Jahren

There is some angular form validation library that does it on keyup, and i can always tell it's angular because after the first keystroke it yells at you for it being invalid

Profilbild von Alex Painter
Alex Paintervor 2 Jahren

At some point this is all going to be too easy. What do we do then? Jokes aside, this is 🔥

Profilbild von Wes Bos
Wes Bosvor 2 Jahren

go outside? Or make another JS framework

Profilbild von Ben Bennitt
Ben Bennittvor 2 Jahren

Working on form validation today. Wes and the X algo delivering 👊

Profilbild von Steve Rios
Steve Riosvor 2 Jahren

VERY nice!

Profilbild von Alexey Lyakhov
Alexey Lyakhovvor 2 Jahren

How long it will take for tailwind to support user-valid/invalid ?

Profilbild von Wes Bos
Wes Bosvor 2 Jahren

Looks like it's already been added, but not yet shipped. You can use [&:user-invalid]:border-red-500 with arbitrary syntax until then

Profilbild von Eddy Erkelens 🧑‍🏫
Eddy Erkelens 🧑‍🏫vor 2 Jahren

@argyleink This should have been launched in 2020. But nevertheless: nice! Handy and usefull!

Profilbild von Juan
Juanvor 2 Jahren

@midudev =O!!

Ähnliche Videos