mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.86k stars 1.9k forks source link

A11y color contrast #6964

Open gvillo opened 1 month ago

gvillo commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.13.2

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

All

Describe the bug

We noticed that some components with many default palette colors are not passing a11y color contrast.

Example: Button variant='light' (violet)

image

This can be tested using devtools in Mantine docs site: https://mantine.dev/core/button/ (I think it works fine mostly with blue, but using the rest of the colors, it's not passing the tests for most of the components).

Edit: Wondering if this is being tested with axe (based on what help center says about accesibility: https://help.mantine.dev/q/are-mantine-components-accessible, it mentions everything except color contrast)

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

I think this can be addressed fixing default color palettes https://mantine.dev/theming/colors/#default-colors, so it can pass a11y color contrast test.

Color contrast should work ok with library default colors, or at least that's what we expect as a user. I am not saying that this should work ok out of the box using a custom palette, because the shades could be wrong.

Self-service

gvillo commented 1 month ago

adding more examples, Alert:

image