All notable changes to the Picture Tag plugin will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
- Initial release of the minimal, high-performance Picture Tag plugin
- WebP & AVIF support with automatic
<source>generation - Responsive
srcsetusing density multipliers (1x, 1.5x, 2x, 3x) - Native lazy loading via
loading="lazy"+ customizabledata-placeholder - SVG optimization & inline rendering with configurable toggle
- Caching layer with
enableCacheandcacheDuration(in seconds) - Debug mode (
enableDebug) for development inspection - Twig functions:
sfs_picture()– Full<picture>tag with WebP/AVIF + fallbackssfs_img()– Responsive<img>withsrcsetsfs_svg()– Inline or<img>SVG renderingsfs_srcset()– Generatesrcsetstring manually
- Project config support – All settings saved to
config/picture-tag.php - Craft CP Settings UI – Clean, tabbed interface with validation
- No JavaScript or CSS bloat – Zero frontend assets by default
| Feature | Description |
| Modern Image Formats | WebP & AVIF via Craft transforms |
| Responsive by Default | Automatic srcset for 1x–3x densities |
| Lazy Loading | Native browser support + 1x1 SVG placeholder |
| SVG Handling | Optimized & inlined when enabled |
| Performance First | Cache + minimal output |
| Developer Friendly | Debug mode, config overrides, clean APIs |
- Built for Craft CMS 5.0+
- Requires PHP 8.2+
- MIT License
- PSR-4 autoloading
- Zero external dependencies
- No frontend JS/CSS included
- Fully compatible with
project.yaml
These features are planned but not included in the current version.
- Default transform system with
enableDefaultTransformsand full control over width, height, quality - Lightbox gallery with swipe & keyboard support
- Art direction with per-breakpoint crops
- Aspect ratio containers (16:9, 1:1, etc.)
- CSS utility classes (
picture-responsive,picture-fit-cover, etc.) - Shimmer placeholder animation
- Error state UI for failed images
- Preload & fetchpriority controls
- Focal point cropping
- Custom breakpoints & sizes
- JavaScript lazy loader (for legacy browsers)
These will be added in future major versions (e.g.
2.0.0) as optional modules.
# Install or update
composer require sfs/craft-picture-tag:^1.0
# Install plugin (if not already)
php craft plugin/install picture-tag
# Or upgrade
php craft plugin/update picture-tag