timmy icon indicating copy to clipboard operation
timmy copied to clipboard

Preserve the class attribute on fallback IMG in PICTURE

Open sque89 opened this issue 1 year ago • 0 comments

When using <picture> some styles still need to be applied on the <img>. One example would be object-fit. So we need a way to provide a CSS class to the fallack <img> inside the picture to apply those styles to it.

This MR checks if a class attribute is available and if so, preserves it on the <img>.

Usage: post.thumbnail|get_timber_picture_responsive($image_size, {class: 'theClass'}) which will set the class attribute of <img> to theClass

sque89 avatar Jan 17 '24 16:01 sque89