Problem/Motivation
I'm using blazy on a page in different layout blocks.
I've noticed the blazy field gets injected with the same classes for all media fields which to me makes no sense.
Steps to reproduce
Create a page with multiple blazy elements, you'll notice the same group of classes is used on all elements instead of the relevant classes per item.
Proposed resolution
Don't make a huge group of classes and render them on all elements but instead only show the relevant classes per item.
The classes are added in an array in the following file:
blazy/src/Attributes.php
in the following function:
/**
* Returns the classes applicable only to the first, not nested containers.
*/
private static function firstClasses(array &$attributes, $blazies, array $options): array {
If you print the classes before the return you'll see the same array that is printed for every item.
Remaining tasks
Needs review