Skip to content

Commit 8dba280

Browse files
authored
Adjust colors based on WCAG contrast criterion (#891)
Merge pull request 891
1 parent ded17a1 commit 8dba280

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

_sass/minima/_layout.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
.footer-col-wrapper,
146146
.social-links {
147147
@include relative-font-size(0.9375);
148-
color: $brand-color;
148+
color: $brand-color-dimmed;
149149
}
150150

151151
.footer-col {
@@ -225,7 +225,7 @@
225225

226226
.post-meta {
227227
font-size: $small-font-size;
228-
color: $brand-color;
228+
color: $brand-color-dimmed;
229229
}
230230

231231
.post-link {

_sass/minima/skins/auto.scss

+10-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ $color-scheme-dark: false !default;
1212

1313
$lm-brand-color: #818181 !default;
1414
$lm-brand-color-light: lighten($lm-brand-color, 40%) !default;
15+
$lm-brand-color-dimmed: darken($lm-brand-color, 11%) !default;
1516
$lm-brand-color-dark: darken($lm-brand-color, 25%) !default;
1617

1718
$lm-site-title-color: $lm-brand-color-dark !default;
@@ -21,7 +22,7 @@ $lm-text-color: $lm-brand-color-dark !default;
2122
$lm-background-color: #fdfdfd !default;
2223
$lm-code-background-color: #f6f8fa !default;
2324

24-
$lm-link-base-color: #2a7ae2 !default;
25+
$lm-link-base-color: #1e69d8 !default;
2526
$lm-link-visited-color: darken($lm-link-base-color, 15%) !default;
2627
$lm-link-hover-color: $lm-text-color !default;
2728

@@ -120,6 +121,7 @@ $lm-table-border-color: $lm-border-color-01 !default;
120121

121122
$dm-brand-color: #999999 !default;
122123
$dm-brand-color-light: lighten($dm-brand-color, 5%) !default;
124+
$dm-brand-color-dimmed: darken($dm-brand-color, 8%) !default;
123125
$dm-brand-color-dark: darken($dm-brand-color, 43%) !default;
124126

125127
$dm-site-title-color: $dm-brand-color-light !default;
@@ -129,8 +131,8 @@ $dm-text-color: darken($dm-heading-color, 15%) !default;
129131
$dm-background-color: #181818 !default;
130132
$dm-code-background-color: #222222 !default;
131133

132-
$dm-link-base-color: #79b8ff !default;
133-
$dm-link-visited-color: $dm-link-base-color !default;
134+
$dm-link-base-color: #5691cd !default;
135+
$dm-link-visited-color: #80bbff !default;
134136
$dm-link-hover-color: $dm-text-color !default;
135137

136138
$dm-border-color-01: $dm-brand-color-dark !default;
@@ -236,6 +238,7 @@ $dm-table-border-color: $dm-border-color-01 !default;
236238

237239
$brand-color: $lm-brand-color;
238240
$brand-color-light: $lm-brand-color-light;
241+
$brand-color-dimmed: $lm-brand-color-dimmed;
239242
$brand-color-dark: $lm-brand-color-dark;
240243

241244
$site-title-color: $lm-site-title-color;
@@ -267,6 +270,7 @@ $table-border-color: $lm-table-border-color;
267270
:root {
268271
--minima-brand-color: #{$lm-brand-color};
269272
--minima-brand-color-light: #{$lm-brand-color-light};
273+
--minima-brand-color-dimmed: #{$lm-brand-color-dimmed};
270274
--minima-brand-color-dark: #{$lm-brand-color-dark};
271275

272276
--minima-site-title-color: #{$lm-site-title-color};
@@ -297,6 +301,7 @@ $table-border-color: $lm-table-border-color;
297301
:root {
298302
--minima-brand-color: #{$dm-brand-color};
299303
--minima-brand-color-light: #{$dm-brand-color-light};
304+
--minima-brand-color-dimmed: #{$dm-brand-color-dimmed};
300305
--minima-brand-color-dark: #{$dm-brand-color-dark};
301306

302307
--minima-site-title-color: #{$dm-site-title-color};
@@ -326,6 +331,7 @@ $table-border-color: $lm-table-border-color;
326331

327332
$brand-color: var(--minima-brand-color);
328333
$brand-color-light: var(--minima-brand-color-light);
334+
$brand-color-dimmed: var(--minima-brand-color-dimmed);
329335
$brand-color-dark: var(--minima-brand-color-dark);
330336

331337
$site-title-color: var(--minima-site-title-color);
@@ -356,6 +362,7 @@ $table-border-color: $lm-table-border-color;
356362

357363
$brand-color: $dm-brand-color;
358364
$brand-color-light: $dm-brand-color-light;
365+
$brand-color-dimmed: $dm-brand-color-dimmed;
359366
$brand-color-dark: $dm-brand-color-dark;
360367

361368
$site-title-color: $dm-site-title-color;

_sass/minima/skins/solarized.scss

+33-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ $sol-is-dark: false !default;
1515
// Color scheme
1616
// ------------
1717
// The inline comments show the canonical L*a*b values for each color.
18+
//
19+
// Some colors were altered from the canonical scheme to comply with
20+
// WCAG-contrast criteria between foreground and background colors.
1821

1922
$sol-base03: #002b36; // 15 -12 -12
2023
$sol-base02: #073642; // 20 -12 -12
2124
$sol-base01: #586e75; // 45 -07 -07
22-
$sol-base00: #657b83; // 50 -07 -07
23-
$sol-base0: #839496; // 60 -06 -03
25+
$sol-base00: #4e626a; // original hex: #657b83 ; L*a*b: 50 -07 -07
26+
$sol-base0: #91a0a1; // original hex: #839496 ; L*a*b: 60 -06 -03
2427
$sol-base1: #93a1a1; // 65 -05 -02
2528
$sol-base2: #eee8d5; // 92 -00 10
2629
$sol-base3: #fdf6e3; // 97 00 10
@@ -33,6 +36,11 @@ $sol-blue: #268bd2; // 55 -10 -45
3336
$sol-cyan: #2aa198; // 60 -35 -05
3437
$sol-green: #859900; // 60 -20 65
3538

39+
// Non-canonical; Derived to comply with WCAG-contrast criterion.
40+
$sol-light-blue: #469edd;
41+
$sol-light-blue2: #64a5ce;
42+
$sol-dark-blue: #2072ac;
43+
$sol-dark-blue2: #376a8b;
3644

3745
// Mixed colors
3846
// ------------
@@ -49,7 +57,6 @@ $sol-dark-mix2: mix($sol-blue, $sol-base0);
4957
$sol-dark-mix3: mix($sol-base02, $sol-base03);
5058
$sol-dark-mix4: #193843; // custom mixture of `$sol-base01` and `$sol-base03`.
5159

52-
5360
// Mode selection
5461
// --------------
5562

@@ -63,6 +70,10 @@ $sol-mix2: $sol-light-mix2;
6370
$sol-mix3: $sol-light-mix3;
6471
$sol-mix4: $sol-light-mix4;
6572

73+
$sol-mono1-dimmed: darken($sol-base1, 20%);
74+
$sol-link-color: $sol-dark-blue;
75+
$sol-link-visited: $sol-dark-blue2;
76+
6677
@if $sol-is-dark {
6778
$sol-mono3: $sol-base03;
6879
$sol-mono2: $sol-base02;
@@ -73,6 +84,10 @@ $sol-mix4: $sol-light-mix4;
7384
$sol-mix2: $sol-dark-mix2;
7485
$sol-mix3: $sol-dark-mix3;
7586
$sol-mix4: $sol-dark-mix4;
87+
88+
$sol-mono1-dimmed: lighten($sol-base01, 16%);
89+
$sol-link-color: $sol-light-blue;
90+
$sol-link-visited: $sol-light-blue2;
7691
}
7792

7893
@if $sol-is-auto {
@@ -86,6 +101,10 @@ $sol-mix4: $sol-light-mix4;
86101
--solarized-mix2: #{$sol-light-mix2};
87102
--solarized-mix3: #{$sol-light-mix3};
88103
--solarized-mix4: #{$sol-light-mix4};
104+
105+
--solarized-mono1-dimmed: #{darken($sol-base1, 20%)};
106+
--solarized-link-color: #{$sol-dark-blue};
107+
--solarized-link-visited: #{$sol-dark-blue2};
89108
}
90109

91110
@media (prefers-color-scheme: dark) {
@@ -99,6 +118,10 @@ $sol-mix4: $sol-light-mix4;
99118
--solarized-mix2: #{$sol-dark-mix2};
100119
--solarized-mix3: #{$sol-dark-mix3};
101120
--solarized-mix4: #{$sol-dark-mix4};
121+
122+
--solarized-mono1-dimmed: #{lighten($sol-base01, 16%)};
123+
--solarized-link-color: #{$sol-light-blue};
124+
--solarized-link-visited: #{$sol-light-blue2};
102125
}
103126
}
104127

@@ -111,6 +134,10 @@ $sol-mix4: $sol-light-mix4;
111134
$sol-mix2: var(--solarized-mix2);
112135
$sol-mix3: var(--solarized-mix3);
113136
$sol-mix4: var(--solarized-mix4);
137+
138+
$sol-mono1-dimmed: var(--solarized-mono1-dimmed);
139+
$sol-link-color: var(--solarized-link-color);
140+
$sol-link-visited: var(--solarized-link-visited);
114141
}
115142

116143

@@ -119,6 +146,7 @@ $sol-mix4: $sol-light-mix4;
119146

120147
$brand-color: $sol-mono1 !default;
121148
$brand-color-light: $sol-mix4 !default;
149+
$brand-color-dimmed: $sol-mono1-dimmed !default;
122150
$brand-color-dark: $sol-mono00 !default;
123151

124152
$site-title-color: $sol-mono00 !default;
@@ -128,8 +156,8 @@ $text-color: $sol-mono00 !default;
128156
$background-color: $sol-mono3 !default;
129157
$code-background-color: $sol-mix3 !default;
130158

131-
$link-base-color: $sol-blue !default;
132-
$link-visited-color: $sol-mix2 !default;
159+
$link-base-color: $sol-link-color !default;
160+
$link-visited-color: $sol-link-visited !default;
133161
$link-hover-color: $sol-mono00 !default;
134162

135163
$border-color-01: $brand-color-light !default;

0 commit comments

Comments
 (0)