Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove missing sizes attribute error when using loading="lazy"—swap to use sizes="auto" instead. #207

Closed
zachleat opened this issue Feb 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@zachleat
Copy link
Member

zachleat commented Feb 2, 2024

Note that "auto" is already supported as a value for sizes in this plugin. This issue is specifically for the error message at:

let missingSizesErrorMessage = `Missing \`sizes\` attribute on eleventy-img shortcode from: ${originalSrc || attributes.src}`;

IMPORTANTLY sizes="auto" is not yet supported anywhere.

https://groups.google.com/a/chromium.org/g/blink-dev/c/OAsmCbjPJz0/m/jzuTJzs1AAAJ

@zachleat
Copy link
Member Author

zachleat commented Jan 3, 2025

Shipping with v6.0.0-beta.1. Beware the browser support here: https://caniuse.com/mdn-html_elements_img_sizes_auto

We’re only using sizes="auto" when sizes is not supplied in markup and only to avoid a build-time error when also using loading="lazy"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant