-
-
Notifications
You must be signed in to change notification settings - Fork 54
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: transform <img>
inside of <picture>
with other sources.
#214
Comments
Hey @zachleat ! Could you please tell me if this will help solve the following problem: Often, I need to have a picture element in advance to apply a class to it. .intro__picture {} But this leads to a nested picture element appearing in the markup after the plugin has processed it. <picture class="intro__picture"> <!-- My picture element -->
<picture> <!-- The picture element from 11ty plugin -->
<img />
</picture>
</picture> As a result, I have to remove the picture element I wrote and rely on the one created by the plugin after it processes. However, writing styles in this case becomes difficult. .intro picture {} Sometimes, there is more than one image in a block, which means additional wrappers need to be created, etc. It seems to me that it would be good if the picture element that appears after the plugin is processed either took all the attributes from the current picture element, or if the plugin completely ignored creating a picture element if one already exists in the markup. |
Just bumping this up as I'm having the same issue @what1s1ove is. If there was a way to add classes to the I know this plugin does something similar: Perhaps we can add a |
<img>
inside of <picture>
with other sources.<img>
inside of <picture>
with other sources.
Support for optimizing <picture class="outer"><source type="image/webp" srcset="./bio-2017.webp 1280w"><img src="./bio-2017.jpg" alt="My ugly mug" class="inner"></picture> transforms to (when more than one entry in <picture class="outer"><source type="image/webp" srcset="/img/KkPMmHd3hP-1280.webp 1280w"><img src="/img/KkPMmHd3hP-1280.jpeg" alt="My ugly mug" class="inner" width="1280" height="853"></picture> Note that attributes on When only one entry is in <img src="/img/KkPMmHd3hP-1280.jpeg" alt="My ugly mug" class="inner" width="1280" height="853"> ( |
Or better: optimize and replace instances of
<picture>
.#208
The text was updated successfully, but these errors were encountered: