feimosi / baguetteBox.js

:zap: Simple and easy to use lightbox script written in pure JavaScript
https://feimosi.github.io/baguetteBox.js/
MIT License
2.44k stars 429 forks source link

Accessibility suggestion (aria roles) #260

Open michaelbourne opened 2 months ago

michaelbourne commented 2 months ago

Howdy,

From a recent 3rd party audit with credentialed accessibility auditors, they had the following to say:

Success criteria

4.1.2 Name, Role, Value (WCAG 2.0 A)

Native Widgets: Link Function & Role

If an anchor element () is coded to function as something other than a link, it must have the correct ARIA widget role.

The image components on this page are coded as links but functions more appropriately as buttons.

Note: When these components are activated they expose a modal.

Remediation Recommendation

Native HTML elements should always be used if possible (eg. use

selyounsi commented 2 months ago

Hey,

I have already optimised the complete BaguetteBox for WCAG 2.0, had to adapt some things, but it works well so far, furthermore I have extended the functionality, you can not only open images in a modal, but also Youtube videos, MP4 and HTML content.

A lot has been adjusted based on version 1.11.1. The plan was to create a new repository named "BaguetteBox++" because, two weeks ago, the last update was from four years ago, so I wasn’t sure if the project was still actively maintained.

@feimosi let me know how to proceed here, it is not little what I have done