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

Eleventy Transform: Use existing width attribute, if set #234

Open
bamnet opened this issue Jul 16, 2024 · 1 comment
Open

Eleventy Transform: Use existing width attribute, if set #234

bamnet opened this issue Jul 16, 2024 · 1 comment

Comments

@bamnet
Copy link

bamnet commented Jul 16, 2024

It's really neat how the eleventyImageTransformPlugin will automatically enhance img tags.

If an img tag already has a width attribute set, it would be helpful if the plugin used that value instead of requiring users to rename the attribute to eleventy:widths.

Example:

<img src="foo.jpg" width="600"> will return the full sized image. The transform plugin silently drops the width parameter. This is confusing and perhaps not what people expect (at least not what I expect).

<img src="foo.jpg" eleventy:widths="600"> fixes it.

@sarajw
Copy link

sarajw commented Oct 13, 2024

Aha! yes please. This has just confused me too: https://front-end.social/@sarajw/113301301029944772

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

No branches or pull requests

2 participants