W3C home > Mailing lists > Public > www-style@w3.org > January 2014

Re: Proposal for image placeholder

From: Binyamin <7raivis@inbox.lv>
Date: Sat, 18 Jan 2014 19:58:43 +0200
Message-ID: <CABj=UkLdBiju5e6cK4YX+P1BeO4h3gT0uxdhnBTuf+vCBdBNFA@mail.gmail.com>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Binyamin <7raivis@inbox.lv>, www-style list <www-style@w3.org>
On Sat, Jan 18, 2014 at 6:16 AM, Andrew Fedoniouk <news@terrainformatica.com>
wrote:
>
> I've found that there is a need for two state flags (a.k.a.
pseudo-classes)
> in practice:
>   :busy - element (e.g. img, object, frame, etc.) is loading its data -
has
>              pending data delivery requests
>   :incomplete - data delivery request has failed, e.g. no image on that
URL.
>
> Having these we can define the following:
>
> img:busy { background-image: url(that-spinning-thing.gif); }
> img:incomplete:not(:busy) : { background-image:
url(no-image-placeholder.gif); }


"placeholder" sounds me more likely than "busy", since :placeholder already
known feature used for form elements. Just on this case - add "placeholder"
support also for images.

I think property has better maintainability than pseudo-element. Think
about .foo:nth-of-type(2):before:placeholder:hover and .foo:nth-of-type(2):
placeholder:before:hover. It could have too big complexibility and too much
bugs.

In case if we decide to use strict property set for "placeholder" like
"background"
style set, then it is more likely to apply it as a property.
If decided to cover all CSS spec customization for image "placeholder",
then apply it as a pseudo-element, but I would not suggest that.

I prefer to apply only "background" style sets for "placeholder" and use it
as a CSS property. Make it simple.


Maybe offer also HTML attribute (for <img>, <svg>) and apply it as
placeholder-image?
Andrew mentioned ":incomplete" has also use case. I would call it as
"placeholder-failed" property.


Binyamin
Received on Saturday, 18 January 2014 17:59:46 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:36 UTC