Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent accidental contrast degradations for styles via test #3390

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"should": "^13.2.3",
"terser": "^5.7.0",
"tiny-worker": "^2.3.0",
"typescript": "^4.4.4"
"typescript": "^4.4.4",
"wcag-contrast": "^3.0.0"
}
}
4 changes: 2 additions & 2 deletions src/styles/arduino-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Arduino® Light Theme - Stefania Mellai <s.mellai@arduino.cc>
*/

.hljs {
background: white;
background: #fff;
color: #434f54;
}

Expand Down Expand Up @@ -50,7 +50,7 @@ Arduino® Light Theme - Stefania Mellai <s.mellai@arduino.cc>
}

.hljs-comment {
color: rgba(149,165,166,.8);
color: #abb7b8;
}

.hljs-meta .hljs-keyword {
Expand Down
4 changes: 2 additions & 2 deletions src/styles/ascetic.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiac
*/

.hljs {
background: white;
color: black;
background: #fff;
color: #000;
}

.hljs-string,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Dark style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Or
.hljs-literal,
.hljs-section,
.hljs-link {
color: white;
color: #fff;
}


Expand Down
2 changes: 1 addition & 1 deletion src/styles/foundation.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Date: 2013-04-02

.hljs {
background: #eee;
color: black;
color: #000;
}

.hljs-link,
Expand Down
4 changes: 2 additions & 2 deletions src/styles/googlecode.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
*/

.hljs {
background: white;
color: black;
background: #fff;
color: #000;
}

.hljs-comment,
Expand Down
4 changes: 2 additions & 2 deletions src/styles/gradient-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Gradient Dark (c) Samia Ali <samiaab1990@gmail.com>

.hljs
{
background: rgb(80,31,122);
background: linear-gradient(166deg, rgba(80,31,122,1) 0%, rgba(40,32,179,1) 80%);
background: #501f7a;
background: linear-gradient(166deg, #501f7a 0%, #2820b3 80%);
color:#e7e4eb;
}

Expand Down
4 changes: 2 additions & 2 deletions src/styles/gradient-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Gradient Light (c) Samia Ali <samiaab1990@gmail.com>

.hljs
{
background: rgb(255,253,141);
background: linear-gradient(142deg, rgba(255,253,141,1) 0%, rgba(252,183,255,1) 35%, rgba(144,236,255,1) 100%);
background: #fffd8d;
background: linear-gradient(142deg, #fffd8d 0%, #fcb7ff 35%, #90ecff 100%);
color:#250482;
}

Expand Down
6 changes: 3 additions & 3 deletions src/styles/isbl-editor-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ISBL Editor style light color schemec (c) Dmitriy Tarasov <dimatar@gmail.com>
*/

.hljs {
background: white;
color: black;
background: #fff;
color: #000;
}

/* Base color: saturation 0; */

.hljs-subst {
color: black;
color: #000;
}

.hljs-comment {
Expand Down
6 changes: 3 additions & 3 deletions src/styles/magula.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Music: Aphex Twin / Xtal

.hljs {
background-color: #f4f4f4;
color: black;
color: #000;
}

.hljs-subst {
color: black;
color: #000;
}

.hljs-string,
Expand Down Expand Up @@ -55,7 +55,7 @@ Music: Aphex Twin / Xtal
.hljs-tag,
.hljs-name {
font-weight: bold;
color: navy;
color: #080;
}

.hljs-emphasis {
Expand Down
2 changes: 1 addition & 1 deletion src/styles/monokai.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Monokai style - ported by Luigi Maselli - http://grigio.org

.hljs-title.class_,
.hljs-class .hljs-title {
color: white;
color: #fff;
}

.hljs-comment,
Expand Down
4 changes: 2 additions & 2 deletions src/styles/night-owl.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ SOFTWARE.

/* diff */
.hljs-addition {
color: #addb67ff;
color: #addb67;
font-style: italic;
}

.hljs-deletion {
color: #EF535090;
color: #87383e;
font-style: italic;
}
5 changes: 3 additions & 2 deletions src/styles/nord.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Aurora

.hljs {
background: #2E3440;
color: #D8DEE9;
}

.hljs,
Expand Down Expand Up @@ -77,11 +78,11 @@ Aurora
}

.hljs-addition {
background-color: rgba(163, 190, 140, 0.5);
background-color: #697966; /* same as #a3be8c80 on top of #2E3440 */
}

.hljs-deletion {
background-color: rgba(191, 97, 106, 0.5);
background-color: #774a55; /* same as #bf616a80 on top of #2E3440 */
}

.hljs-built_in,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/obsidian.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
.hljs-title.class_,
.hljs-class .hljs-title,
.hljs-section {
color: white;
color: #fff;
}
1 change: 1 addition & 0 deletions src/styles/purebasic.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ NOTE_2: Color names provided in comments were derived using "Name that Color" on

.hljs {
background: #FFFFDF; /* Half and Half (approx.) */
color: #000000; /* Black */
}

.hljs, /* --- used for PureBASIC base color --- */
Expand Down
10 changes: 5 additions & 5 deletions src/styles/tomorrow-night-blue.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */

.hljs {
background: #002451;
color: #fff;
}

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
Expand Down Expand Up @@ -57,11 +62,6 @@
color: #ebbbff;
}

.hljs {
background: #002451;
color: white;
}

.hljs-emphasis {
font-style: italic;
}
Expand Down
10 changes: 5 additions & 5 deletions src/styles/tomorrow-night-bright.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */

.hljs {
background: #000;
color: #eaeaea;
}

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
Expand Down Expand Up @@ -56,11 +61,6 @@
color: #c397d8;
}

.hljs {
background: black;
color: #eaeaea;
}

.hljs-emphasis {
font-style: italic;
}
Expand Down
4 changes: 2 additions & 2 deletions src/styles/vs.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Visual Studio-like style based on original C# coloring by Jason Diamond <jason@d

*/
.hljs {
background: white;
color: black;
background: #fff;
color: #000;
}

.hljs-comment,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/vs2015.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}

.hljs-section {
color: gold;
color: #ffd700;
}

.hljs-emphasis {
Expand Down
2 changes: 1 addition & 1 deletion src/styles/xcode.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>

.hljs {
background: #fff;
color: black;
color: #000;
}

/* Gray DOCTYPE selectors like WebKit */
Expand Down
Loading