← Back to release summary

:user-valid and :user-invalid CSS pseudo-classes

Category
DOM
Type
Chromium catches up
Status
Enabled by default (Chrome 119)
Intent stage
None

Summary

The :user-invalid and the :user-valid pseudo-classes represent an element with incorrect or correct input, respectively, but only after the user has significantly interacted with it. This is similar to :valid and :invalid, but with the added constraint that these pseudo-classes only match after the user has interacted with the element.

Standards & signals

Samples: https://developer.mozilla.org/en-US/docs/Web/CSS/:user-valid

View on chromestatus.com