unveil2 icon indicating copy to clipboard operation
unveil2 copied to clipboard

Add srcset support

Open BeatLaG opened this issue 9 years ago • 6 comments

Since Wordpress implements this feature natively, it would be awesome seeing the plugin to handle images sets :)

BeatLaG avatar Mar 12 '16 17:03 BeatLaG

Thanks, good suggestion!

hongaar avatar Mar 15 '16 08:03 hongaar

@BeatLaG Do you know how WordPress handles IE? Do they use a polyfill or do they just degrade the experience on IE?

hongaar avatar Mar 16 '16 08:03 hongaar

Looks like they are using a polyfill to handle old browsers based in -> https://scottjehl.github.io/picturefill/ adding in this way an extra dependency :(

BeatLaG avatar Mar 16 '16 11:03 BeatLaG

Yeah that's too bad, but I think in the end it would still be cleaner to use srcset as opposed to the current situation: viewport width calculations and using a rather verbose syntax.

hongaar avatar Mar 16 '16 12:03 hongaar

Currently, around 65% of browsers used (globally, 75% in USA) support the srcset attribute (caniuse).

Picturefill looks really nice, but its minified source is 11.5 KB (compared to currently 2 KB for unveil2).

Maybe we should just include instructions on how to include picturefill and leave the choice of using it up to users? Upside is modularity, downside is extra complexity (which will will fade away over time as browser support increases).

hongaar avatar May 06 '16 10:05 hongaar

I totally agree, Joram. Let the user choose would cover any scenario. In the worst case when not implementing a polyfill the markup would be only working for the main src attribute and not affecting to the other pictures set, this would result in non broken layouts in any case. The only point would be that unveil would not work for those pictures in the set.

To me it sounds perfect, much better that bloating the plugin and doing it heavy.

BeatLaG avatar May 09 '16 07:05 BeatLaG