Re: [csswg-drafts] [selectors-4] additional resource state pseudo-classes for img / picture elements (#7467)

_Context: I maintain [Unpic](https://github.com/ascorbic/unpic-img/), and built the official responsive image support in Gatsby and Astro._

I found this after @una asked framework authors for UI needs and went to look if it had been proposed. This would be very useful for implementing image loading placeholders. I like @Crissov's proposal, but there are some states that would not map to HTTP response codes. Most importantly `:loading` should also match images where a response has not been received yet. I'd also bikeshed `:loaded` as being better than `:complete`. 

It would also be helpful to a pseudo-class to match lazy-loaded images that are not being loaded, because they are offscreen or whatever (`:pending` maybe? `:offscreen`?)

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


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

Received on Thursday, 28 August 2025 08:36:44 UTC