Skip to content

Fix responsive image fallback in card components - #84

Open
ankit02327 wants to merge 1 commit into
wagtail:mainfrom
ankit02327:fix-responsive-image-fallback
Open

Fix responsive image fallback in card components#84
ankit02327 wants to merge 1 commit into
wagtail:mainfrom
ankit02327:fix-responsive-image-fallback

Conversation

@ankit02327

@ankit02327 ankit02327 commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

Updates the card components so the <img> fallback uses the JPEG rendition instead of WebP.

In a <picture> element, the <img> tag acts as the final fallback for browsers that do not support the <source> formats. Using JPEG here ensures broader compatibility when WebP is not supported.

Related to issue #8.

AI Usage

None

@zerolab

zerolab commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

WebP is widely supported - https://caniuse.com/webp

@ankit02327

Copy link
Copy Markdown
Contributor Author

Thanks for pointing that out. You're right that WebP now has very broad browser support.

My intention was mainly to make the <img> element act as a more traditional fallback since the <picture> already provides WebP and JPEG sources. But if keeping WebP in the <img> is preferred given the current browser support, I'm happy to revert this change.

Let me know what you’d prefer.

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

Successfully merging this pull request may close these issues.

2 participants