-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Allow using <picture> instead of <img> for webp and other images types support #361
Comments
Hey there @FurmigaHumana, I agree, adding some sort of |
Running into this With Joomla 4+, not with the picture but with the figure element. Just my 2cts. Hope this helps! |
Hey there @Ruud68 If you have access enough to the glightbox initializing, you could change the selector to be something like Edit: I'm realizing that markdown has changed some of your comment into invalid HTML, but hopefully this helps solve your problem anyways. P.S. Updated your comment to stop the markdown from handling the HTML like that :) |
@gingerchew that is actually awesome as it solves this use case! This is what I now have as selector, added also the picture element as for this likely the same applies:
Thanks a lot for solving this for me! |
glad it helped! |
The img element alone is not enough to provide a wide range of image types for optimized delivery.
Using picture instead allow us to provide multiple sources so the browser can pick the most optimized format possible.
For instance most modern browsers can pick the webp variant while falling back to png/jpg if not supported.
Maybe it could be a "sources" option key, something like:
example html:
The text was updated successfully, but these errors were encountered: