| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Some of these are probably unnecessary (ASCII-only content), but it's
easier not to think about it.
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: andy <andy.yu2k@gmail.com>
Co-authored-by: Jean-Abou-Samra <jean@abou-samra.fr>
|
| |
|
| |
|
| |
|
|
|
|
| |
Part of #1718.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Part of #1718.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
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.
|