summaryrefslogtreecommitdiff
path: root/tests/contrast
Commit message (Collapse)AuthorAgeFilesLines
* Fix some pyflakes lints in tests/ and scripts/ (#2333)Jean Abou-Samra2023-02-011-1/+0
|
* Fix lots of missing encoding="utf-8" parametersJean Abou Samra2023-01-311-2/+2
| | | | | Some of these are probably unnecessary (ASCII-only content), but it's easier not to think about it.
* Native: fix contrast ratio to meet WCAG AA guidelinesHugo van Kemenade2023-01-291-1/+1
|
* Add GitHub's Dark Style (#2192)Aniket Teredesai2022-07-271-2/+4
|
* Nord theme (#2189)Mateus Furquim2022-07-151-2/+4
| | | | Co-authored-by: andy <andy.yu2k@gmail.com> Co-authored-by: Jean-Abou-Samra <jean@abou-samra.fr>
* Update CHANGES, contrast for friendly grayscale.Matthäus G. Chajdas2021-12-281-0/+1
|
* Various small cleanups.Matthäus G. Chajdas2021-11-211-1/+2
|
* Register the one-dark style.Matthäus G. Chajdas2021-11-211-1/+2
|
* Slightly adjust sas style to meet WCAG AAMartin Fischer2021-11-141-1/+1
| | | | Part of #1718.
* Add missing colors to dark stylesMartin Fischer2021-11-141-4/+4
| | | | | | | | | | | | | Some dark styles did not define a color for every token type, resulting in black text (the browser default for text) on dark backgrounds (defined by the styles) unless the web page had some CSS to remedy that like: body { color: white; background: black; } We however don't want the readability of styles to rely on external CSS. Part of #1718. Fixes some unreadable styles reported in #1526.
* Promote styles meeting WCAG AA in styles gallery (#1954)Martin Fischer2021-11-141-4/+8
| | | Part of #1718.
* Make default style meet WCAG AAMartin Fischer2021-11-021-1/+1
| | | | | | | | | Accessibility by default is important. The colors with a too low contrast were adjusted just so much that they match the required contrast of 4.5. Part of #1718.
* Make test_contrasts.py ignore token.Whitespace (#1938)Martin Fischer2021-11-022-16/+18
| | | | | | | | | | | | | With the VisibleWhitespaceFilter Pygments can be configured to replace whitespace characters like spaces, tabs and newlines with Unicode characters like ·, » and ¶ respectively. The min_contrast metric is meant to represent the readability of a style. Increasing it should mean that the style becomes more readable. This commit therefore excludes the token.Whitespace contrast from the min_contrast calculation, since giving whitespace characters a high contrast would make them so intrusive that they would actually hinder the readability of the source code.
* Make test_contrats.py account for bgcolor (#1937)Martin Fischer2021-11-022-12/+11
|
* Prohibit contrast degradation for styles via test (#1919)Martin Fischer2021-11-012-0/+139
Web accessibility is important. Unfortunately currently many pygments styles have rules with poor contrasts. This commit introduces a test case that fails if the minimum contrast of a style gets worse, e.g: E AssertionError: contrast degradation for style 'borland' E The following rules have a contrast lower than the required 2.9: E E * 1.90 Token.Text.Whitespace E * 2.80 Token.Generic.Heading E * 2.30 Token.Generic.Subheading E E assert not 1.9 < 2.9 This is accomplished by storing the current minimum contrasts in ./tests/contrast/min_contrasts.json. When you improve a minimum contrast the test fails with: E AssertionError: congrats, you improved a contrast! please run ./scripts/update_contrasts.py E assert not 1.9 > 0.9 Running the script as instructed updates the JSON file, making the test pass. New styles are required to meet the WCAG AA contrast minimum of 4.5. First commit to address #1718.