Skip to content

Commit 0849615

Browse files
committed
colors for accessibility, knowls, assemblages
1 parent f6958da commit 0849615

File tree

4 files changed

+87
-13
lines changed

4 files changed

+87
-13
lines changed

Diff for: colors_default.css

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11

22
/*
3-
There are four main choices that define a color scheme in the
3+
There are five main choices that define a color scheme in the
44
HTML output of PreTeXt:
55
1) A dark color for the title on each page
66
2) A dark color for highlighted words in the body
7+
3) A dark color for other highlighted words in the body
78
8-
In the CSS those are called 'documenttitle' and 'bodytitle'.
9-
Often those are equal.
9+
In the CSS those are called 'documenttitle', 'bodytitle',
10+
and 'bodysubtitle'.
1011
1112
The other two choices appear in the ToC.
1213
@@ -37,8 +38,15 @@
3738

3839
:root {
3940
--documenttitle: #932919;
40-
--bodytitle: #932919;
41-
--bodyverylight: #ffdfcf;
41+
--bodytitle: #A62E1C; /* often a darker version of documenttitle */
42+
--bodysubtitle: #2B5F82; /* can be the same as bodytitle */
43+
--bodytitlehighlight: #e0e9ff; /* light, and contrasting to bodytitle */
44+
--bodysubtitlehighlight: #fce5e4; /* light, and contrasting to bodysubtitle */
45+
/*
46+
The bodytitle and bodysubtitle colors must have at least a 3:1 contrast
47+
ratio with black, and at least 5:1 ratio with with the corresponding highlight.
48+
(The second condition will guarantee an adequate contrast with white.)
49+
*/
4250

4351
--chaptertoc: #3572a0;
4452
--chaptertoctext: white;
@@ -53,5 +61,11 @@
5361
--highlighttoc: #671d12;
5462
--highlighttoctext: white;
5563
--highlighttocborder: var(--chaptertoc);
64+
65+
--assemblageborder: #5B2F82;
66+
--assemblagebackground: #f5f8ff;
67+
68+
--knowlborder: #e0e9ff;
69+
--knowlbackground: var(--assemblagebackground);
5670
}
5771

Diff for: colors_pastel_blue_orange.css

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
:root {
55
--documenttitle: #2a5ea4;
6-
--bodytitle: #932c1c;
7-
--bodyverylight: #ffdfcf;
6+
--bodytitle: #A62E1C;
7+
--bodysubtitle: #2B5F82;
8+
--bodytitlehighlight: #e0e9ff;
9+
--bodysubtitlehighlight: #FCE5E4;
810

911
--chaptertoc: #dbf5ff;
1012
--chaptertoctext: #444444;
@@ -19,5 +21,12 @@
1921
--highlighttoc: #fac793;
2022
--highlighttoctext: #321a0c;
2123
--highlighttocborder: #ec704b;
24+
25+
--assemblageborder: #1100aa;
26+
--assemblagebackground: #f4f4fe;
27+
28+
--knowlborder: #e0e9ff;
29+
--knowlbackground: #f5f8ff;
30+
2231
}
2332

Diff for: pretext_add_on.css

+26-5
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ article > [data-knowl]::after, article > [data-knowl]:hover::after, article > [d
396396
color: red;
397397
border-bottom: 0;
398398
}
399-
.knowl-output {
399+
.XXknowl-output {
400400
background: #f5f5ff;
401401
border-top: 10px solid #ddf;
402402
border-left: 10px solid #ddf;
@@ -407,19 +407,29 @@ article > [data-knowl]::after, article > [data-knowl]:hover::after, article > [d
407407
border-bottom-right-radius: 10px;
408408
border-top-right-radius: 10px;
409409
display: none;
410-
display: none;
411410
padding: 0px;
412411
margin-top: 10px;
413412
/*
414413
margin-bottom: 0px;
415414
*/
416415
margin-right: 0px;
417-
418416
}
417+
.knowl-output {
418+
background: #f5f5ff;
419+
border: 10px solid #ddf;
420+
border-radius: 10px;
421+
display: none;
422+
padding: 0;
423+
margin-top: 10px;
424+
}
425+
426+
427+
/*
419428
.knowl-output .knowl-output, .knowl-output .knowl-output.loading {
420429
margin-left: 0;
421430
margin-right: 0;
422431
}
432+
*/
423433
.knowl-output .knowl-output {
424434
border-width: 6px;
425435
background: #fffff5;
@@ -429,10 +439,11 @@ article > [data-knowl]::after, article > [data-knowl]:hover::after, article > [d
429439
margin-right: -7px;
430440
}
431441
.knowl-output .knowl-output .knowl-output {
432-
background: #fff5fe;
442+
background: #f0f0ff;
443+
background: #fff5ff;
433444
}
434445
.knowl-output .knowl-output .knowl-output .knowl-output {
435-
background: #ffffff;
446+
background: #fafffa;
436447
}
437448
.knowl-footer {
438449
position: relative;
@@ -2184,6 +2195,9 @@ from Jiří Lebl */
21842195
margin-left: 0;
21852196
margin-right: 0;
21862197
}
2198+
.pretext-content a .code-inline {
2199+
background: #f6f6f6;
2200+
}
21872201

21882202
.pretext-content .sagecell_sessionOutput pre {
21892203
font-family: 'Inconsolata', monospace;
@@ -3221,6 +3235,13 @@ and condider having this replace line 3338 of the general code (which uses .head
32213235
background-color: #ffd;
32223236
}
32233237

3238+
.pretext-content a.internal:hover,
3239+
.pretext-content a.external:hover,
3240+
.pretext-content a.internal:focus,
3241+
.pretext-content a.external:focus {
3242+
text-decoration: underline;
3243+
}
3244+
32243245
/* style for poems */
32253246

32263247
.pretext-content .poem {

Diff for: setcolors.css

+31-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,36 @@
8080
color: var(--bodytitle);
8181
}
8282
.pretext-content [data-knowl]:hover, .pretext-content [data-knowl]:active, .pretext-content [data-knowl].active {
83-
background: var(--bodyverylight);
83+
background: var(--bodytitlehighlight);
8484
}
8585

86+
/* next two groups concern accessibility, so check when making changes */
87+
.pretext-content a.internal {
88+
color: var(--bodytitle);
89+
}
90+
.pretext-content a.external {
91+
color: var(--bodysubtitle);
92+
}
93+
.pretext-content a.internal:hover, .pretext-content a.internal:hover *,
94+
.pretext-content a.internal:focus, .pretext-content a.internal:focus * {
95+
background-color: var(--bodytitlehighlight);
96+
}
97+
.pretext-content a.external:hover, .pretext-content a.external:hover *,
98+
.pretext-content a.external:focus, .pretext-content a.external:focus * {
99+
background-color: var(--bodysubtitlehighlight);
100+
}
101+
102+
.pretext-content .assemblage-like {
103+
border: 2px solid var(--assemblageborder);
104+
background: var(--assemblagebackground);
105+
}
106+
107+
.knowl-output {
108+
border: 10px solid var(--knowlborder);
109+
background: var(--knowlbackground);
110+
}
111+
.knowl-footer {
112+
background: var(--knowlborder);
113+
}
114+
115+

0 commit comments

Comments
 (0)