Quansight-Labs / accessible-pygments

♿ Accessible pygments themes
https://quansight-labs.github.io/accessible-pygments/
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

Line highlight color against background color does not meet WCAG (3:1) #36

Open gabalafou opened 9 months ago

gabalafou commented 9 months ago

I think this might be an issue for all of the themes under this repo but this is definitely an issue for a11y-light.

Between the background color of the code block and the background color of a highlighted line, WCAG guidelines require that the contrast ratio between those two to be 3:1, but it's much less.

I suspect that it's not possible (or very hard) to find a color palette that meets the following three criteria:

Eric Bailey's solution was to put a top and bottom border on highlighted lines. We could do the same thing but we would have to modify the CSS that we get back from Pygments, which we already do in the generate_css() function in utils.py.

Originally posted by @gabalafou in https://github.com/Quansight-Labs/accessible-pygments/issues/33#issuecomment-1926206399