Closed lukasbestle closed 2 weeks ago
In general: The fluid layout makes everything a sliding scale. So:
srcset
numbers are mostly chosen by feeling except those exact sizes in the max-width
case we know,sizes
thresholds are also rough as I couldn't reliably determine all exact breakpoints (if you know or can determine them, feel free to edit those directly) andsizes
vw units are rough by definition because of the fluid layout (the margins are often static, but the images scale fluidly, which prevents the ratios from being exact for the entire scale). I have chosen those to fit for the part of the breakpoint where the image is 80-90% of its maximum size.
Description
Summary of changes
img()
helper that are lazy-loaded (which is the default) now get asizes="auto"
attribute if not passed manuallysizes
attribute is set for those LCP images so that the browser can immediately load the correctsrcset
variantReasoning
Additional context
Images "below the fold" are still lazy-loaded. With
sizes="auto"
, modern browsers can figure out the correct sizes better than we can manually. So I didn't touch these.