diff --git a/classes/TagGenerator.php b/classes/TagGenerator.php index 6f4f523..c2db8b1 100644 --- a/classes/TagGenerator.php +++ b/classes/TagGenerator.php @@ -100,7 +100,8 @@ class TagGenerator { 'sizes' => $sizes->implode(', '), $options['lazy'] ? 'data-srcset' : 'srcset' => $srcset->implode(', '), $options['lazy'] ? 'data-src' : 'src' => $files->last()->get('url'), - ])); + 'class' => data_get($options, 'class'), + ])->filter(fn ($value) => (bool) $value)); } public function singleFile(MediaPath $path, ?string $ratio = 'original'): string