WICG / intrinsicsize-attribute

Proposal to add an intrinsicsize attribute to media elements
Apache License 2.0
93 stars 14 forks source link

Allow intrinsicsize on other elements #9

Open eeeps opened 6 years ago

eeeps commented 6 years ago

Seems like it may open cans of worms, but – I have two use cases, one more fleshed out than the other...

  1. Placeholders for images to be loaded later. For instance, let’s say I’m lazyloading or click-to-loading an image, and am using <a class="lazy-img" href="image.jpg">alternative text</a> as a fallback, like this: https://codepen.io/eeeps/pen/mGavRP. Being able to set an intrinsicsize on the <a> would be very useful; I can't think of another clean way to get it to be sized just like the eventual image will be, if the image is flexible in one dimension.

  2. Custom elements, which may be doing custom replaced-element-y things?