image icon indicating copy to clipboard operation
image copied to clipboard

Support arbitrary values for the "sizes" attribute

Open luksak opened this issue 4 years ago • 0 comments

I think that supporting arbitrary values for the sizes attribute should be possible like this:

<nuxt-picture
  src="/images/mountains.jpg"
  sizes="100vw"
/>

Or maybe even more important more complex examples like this:

<nuxt-picture
  src="/images/mountains.jpg"
  sizes="(max-width: 960px) 33vw, 100vw"
/>

Basically we should support all valid values as documented here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes

Here is a sandbox of an example:

https://codesandbox.io/s/jolly-kate-febtx?file=/pages/index.vue

luksak avatar Jan 05 '22 02:01 luksak