Conversation
jeanas
left a comment
There was a problem hiding this comment.
LGTM with a couple of nits.
|
CI fails because this style has quite low contrast, which is a bit sad. OTOH, I'm not sure if there's much we can do about that given it's designed by other people and maintained consistent across an array of tools. I see that they increased the contrast for comments at some point, nordtheme/nord#94. Did you incorporate that change? Otherwise, I'm afraid we can't do much more than bypassing this test by editing the |
|
I didn't know about this change they've made. I just updated it to include the |
|
Also, the file header check fails, you need to do diff --git a/pygments/styles/nord.py b/pygments/styles/nord.py
index 94c7f23a..15b6d5cb 100644
--- a/pygments/styles/nord.py
+++ b/pygments/styles/nord.py
@@ -1,12 +1,12 @@
"""
pygments.styles.nord
- ~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~
pygments version of the "nord" theme by Arctic Ice Studio
https://www.nordtheme.com/
- :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
- :license: BSD-3 Clause License. See LICENSE for details
+ :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
+ :license: BSD, see LICENSE for details.
"""
|
|
As they apparently more or less standardized on 10%, I think it's OK to stay with that. This style is not going to be a high-contrast one in any case. That's fine; if you use Pygments just for yourself or for a specific set of people you know, and nobody visually impaired is expected to view the output, a low-contrast style is OK. It's also perfectly OK to provide two versions of the same content, one of which is adapted for low vision. IMHO, we just need to state clearly that the contrast is low, which the style gallery at https://pygments.org/styles/ does. So I suggest you do: diff --git a/tests/contrast/min_contrasts.json b/tests/contrast/min_contrasts.json
index ee804304..c8002653 100644
--- a/tests/contrast/min_contrasts.json
+++ b/tests/contrast/min_contrasts.json
@@ -42,5 +42,7 @@
"gruvbox-light": 3.2,
"dracula": 1.4,
"one-dark": 3.7,
- "lilypond": 2.3
+ "lilypond": 2.3,
+ "nord": 2.4,
+ "nord-darker": 2.8
}
\ No newline at end of file |
|
Just out of curiosity, what are those numbers in |
|
It maps style names to min contrast. The contrasts are measured according to the WCAG indicator. The min contrast is just the minimum of the contrasts for each of the tokens in a style. I got those figures by running |
Hi
It's been more than one year since @yu-andy opened the MR #1799 to add the nord theme. He hasn't added the requested modifications, so I'm opening this PR as suggested by @timskovjacobsen in this PR.
The two new styles that I am adding are the original nord theme and a nord theme with a darker background (a personal preference).
This darker color is the darkest background from their website.
Both images were generated with the following command:
pygmentize -v \ -o nord.png \ -O hl_lines="1 3 4",style=nord,line_numbers=False,font_name=FiraCode \ -f png \ random_number_1_10.shOriginal nord theme

Nord with darker background

Any suggestions or comments, just let me know and I will make the appropriate changes.