Skip to content

Add ALT attribute to images in carousel #88

@stefanoel

Description

@stefanoel

Hi! Some accessibility tools require alt attribute for images in the carousel.

<div class="ratio ratio-16x9" style="background-color: #000;"><img src="photo.jpg" class="d-block mw-100 mh-100 h-auto w-auto m-auto top-0 end-0 bottom-0 start-0 img-fluid" style="z-index: 1; object-fit: contain;"></div><p class="lightbox-caption m-0 p-2 text-center text-white small"><em>Photo description</em></p>

I think you can use the alt text provided by the thumbnail image (if there's one) or the data-caption value... something like this (line 138):

let inner = <img alt="${params.get('caption')}" src="${url}" class="d-block ${imgClasses} img-fluid" style="z-index: 1; object-fit: contain;" />;

but, of course, you have to check if there's a data-caption or an alt text...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions