lucaspulliese / vue-cool-lightbox

Vue.js lightbox inspired by fancybox.
https://vue-cool-lightbox.lucaspulliese.com
341 stars 54 forks source link

feat: Add support for picture, srcset and sizes attributes #88

Closed TroAlexis closed 3 years ago

TroAlexis commented 3 years ago

It was not possible to have srcset and sizes on img or to use picture element to support webp format, for example.

Possibility added, you can now pass srcset and sizes to image object and put a picture object into it.

The structure is the following

{ srcset, sizes, picture: { sources: [{ srcset, type, sizes}] }}

If no sizes stated for a picture source it will default to img 'sizes' property.

lucaspulliese commented 3 years ago

Hi @TroAlexis!

First of all, apologies for not having seen the PR before, I am with other occupations and it is difficult for me to keep the component updated. On the other hand I thank you very much for this feature, it is something that I wanted to do and add as soon as possible.

You're awesome. I will let you know when the component it's updated on npm.

lucaspulliese commented 3 years ago

@TroAlexis this feature is added in 2.7.2 version.

Again, thank you very much!

TroAlexis commented 3 years ago

@lucaspulliese No problem, It's a pleasure to contribute to such a great component!

Just realized that I forgot about adding support for media attribute on picture sources, will get back to it and submit a PR soon.

lucaspulliese commented 3 years ago

That would be great, thanks again @TroAlexis!