Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
Automatically setting img "sizes" attribute using ResizeObserver

A blog post I recently read suggested setting the sizes attribute of <img> tags automatically, using a ResizeObserver.

This would mean that at different image widths (in practice usually different breakpoints) the sizes would update each time the image resizes.

Imgix is doing something similar, and they state:

The sizes attribute was designed to give the break-points information to the browser as early as possible, typically before the images on the page have even rendered. Because imgix.js is loaded after the page's HTML markup, the browser gets the information about sizes just a tad-bit later than usual. This means that some of the performance gains from using the sizes attribute are lost, since the browser has to wait for imgix.js to load before it can make a decision.

Is this approach useful at all? Or is it wrongly using what was intended to be a static hint at image widths?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda