Install
Works with Drupal: ^10.2 || ^11 || ^12Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Container Query Images 2.0.0
Breaking change
Version 2.0.0 changes how container-query images are selected in the browser.
1.x copied one srcset onto the
and let JavaScript pick the URL.
2.x keeps the native
/ structure. PHP starts with every disabled (media="not all"). JavaScript only enables the matching container-width group and leaves format selection to the browser.
Sites on 1.x are not upgraded automatically if they require ^1.0.
Benefits
Native browser behaviour — the browser chooses the image URL and density from srcset / sizes on each , instead of custom JS rewriting the
.
Multiple image formats — several entries for the same width (e.g. AVIF, WebP, JPEG/PNG) stay intact, so the browser can pick the best supported format.
Better network & EcoIndex impact — only the matching width group is active; format negotiation stays native, which helps avoid oversized or wrong-format downloads and reduces wasted bytes.
Browser support — Chrome 105+, Safari 16+, Firefox 110+. Older browsers fall back to ResizeObserver (or window resize).
Other changes
Responsive image style forms hide the viewport sizes mapping for container breakpoint groups (one image style per breakpoint multiplier).
Drupal core compatibility: ^10.2 || ^11 || ^12.
