image icon indicating copy to clipboard operation
image copied to clipboard

default sizes

Open tasiotas opened this issue 2 years ago • 5 comments

Hi,

Is it possible to define default sizes?

I tried to put it in the preset, but looks like it for modifiers only. Setting custom screens config also isn't the way to go.

Perhaps its not implemented yet? I would like to specify global (or per preset) list of responsive sizes to be generated. '100px md:400px xl:800px' for example

https://stackblitz.com/edit/github-dccw3y?file=nuxt.config.ts

tasiotas avatar Oct 24 '23 19:10 tasiotas

same issue with densities and format defined in defineNuxtConfig. They are all being ignored. Only works if I define all those props on the <NuxtImg> or <NuxtPicture>

tasiotas avatar Oct 24 '23 23:10 tasiotas

any update on that? Same issue for me with [email protected] and nuxt/[email protected]. Vercel as a nitro provider, but also not working without that or with that on my local M1 Pro Macbook Pro.

SuddenDev avatar Nov 20 '23 21:11 SuddenDev

Same here, by default it generates an obscene amount of images (especially with WEBP and/or AVIF support enabled)

Voltra avatar Nov 28 '23 09:11 Voltra

Maybe it's not very related to this, but it's also about the default sizes, the latest HTML standard specification has a new sizes=auto option, for loading=lazy images, the browser will automatically request the best image based on the display size, in nuxt image, if sizes is not set, and loading=lazy is enabled, maybe auto will be a good default.

Related Links:

  1. https://html.spec.whatwg.org/#sizes-attributes
  2. https://github.com/whatwg/html/issues/4654

everyx avatar Dec 04 '23 01:12 everyx

any update on that? Same issue for me with [email protected] and nuxt/[email protected]. Vercel as a nitro provider, but also not working without that or with that on my local M1 Pro Macbook Pro.

I'm noticing the same now, the format and quality settings in nuxt.config.ts are just ignored. Has anyone else noticed?

notflip avatar Feb 21 '24 14:02 notflip