Re: [csswg-drafts] [selectors] Pseudo-classes for image state (#3134)

For years, I’ve felt the absence of a `:complete` pseudo-class in CSS—especially when working with avatars.

One recurring issue: users upload profile images with transparent backgrounds, expecting a clean display. But instead, the fallback (like initials on a colored background) stubbornly shows through, creating an awkward visual overlap. The image loads, but CSS has no way of knowing it’s ready to take over.

The only workaround? JavaScript. We’ve had to manually listen for the `load` event and toggle a class like `complete`  just to style things correctly. It’s clunky, error-prone, and feels like a hack for something CSS should handle natively.

To support the case for a  pseudo-class, I’ve written a post diving into the problem and the potential solution:
👉 [From Skeletons to Smooth Reveals: A Case for the :complete pseudo-class](https://th3s4mur41.me/blog/css-complete-pseudo-class/)


-- 
GitHub Notification of comment by Th3S4mur41
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3134#issuecomment-3279767834 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 September 2025 10:23:23 UTC