cosmos
cosmos copied to clipboard
[Accessibility] Image component: Make alt text required
trafficstars
On #1244 we introduced accessibility docs on the Image component.
@siddharthkp made a point to make the prop mandatory: https://github.com/auth0/cosmos/pull/1244/files#r240902617
Since images on cosmos components don't have alt text, then we end up with a warning.
This issue is to make the alt text requiered and try to automize it as much as possible, for example:
- On Avatar blocks, make the alt text "picture of [USERNAME]" or something like "Generic avatar picture" if the default is shown.
- On avatar with logo, we can do something like "logo of [BRAND]"
The smarter we can make, the less prone to user failire we'll be.
We should also add the possibility for the user to overwirte it (like we do with autogenerated ids)
https://design-system.service.gov.uk/styles/images/
Hello @andresgalante!
First time contributor here, and wondering if I can take a try at this!