Closed sque89 closed 1 month ago
Hi @gchtr, do you think this can be merged anytime soon? Thanks a lot!
@sque89 I added a test and documentation for this in #84 and merged it in.
I also renamed the argument from class
to img_class
. I did this because in the future, there might be a function that also adds the <picture>
tag. There, we could also have a class
argument and we would have to discern between the class for the <picture>
and the class for the <img>
tag.
This is now released in https://github.com/mindkomm/timmy/releases/tag/v2.1.0.
When using
<picture>
some styles still need to be applied on the<img>
. One example would beobject-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>
totheClass