tevko / wp-tevko-responsive-images

Fully responsive image plugin for wordpress
113 stars 73 forks source link

srcset #11

Closed chriscoyier closed 10 years ago

chriscoyier commented 10 years ago

One of the primary reasons to use <picture> is having entirely different images being swapped out depending on the circumstances (art direction).

In the case of this plugin, the images are auto-generated re-sizings, which is a better fit for srcset.

http://codepen.io/anon/pen/eIcKz

https://twitter.com/yoavweiss/status/478648919917068288

http://scottjehl.github.io/picturefill/

It's a little weird to me still, because obviously picture CAN be used for this, and you CAN do art direction with srcset as well, sooooo. ¯(ツ)

tevko commented 10 years ago

Are there any downsides to keeping the current syntax?

chriscoyier commented 10 years ago

That's the ultimate question. I'd leave this open a few weeks maybe and see if someone can lay out a solid case. If not, close it.

emzo commented 10 years ago

I definitely agree that srcset and sizes is the way to go with a plugin like this. Since most people won't be doing art direction. The other factor is context of the image on the page. We don't know if the image will be placed on a full-width page, or on a page with sidebars, or in a WordPress widget within a sidebar. By using srcset and sizes, we load the most suitable image for the context, rather than by media queries alone. Eric Portis has a great article on the use of srcset and sizes at http://ericportis.com/posts/2014/srcset-sizes/