Skip to content

Commit 62a24f3

Browse files
ntnocowellbunga
andauthored
high contrast palettes (#211)
* Palette wcag review (#154) * Add new palettes * change palette review href's to main page links --------- Co-authored-by: ntno <ntno@users.noreply.github.com> * include proposed palettes in test suite * increased contrast * increase contrast * increase contrast * remove wip palettes * update footnotes and footnote links * regenerate updated palettes on demo site * note new palettes and plan for failing palettes * rename markdown for consistency, update links * minor version bump * add 4.8.0 to releases --------- Co-authored-by: Chandler Cowell <64285308+cowellbunga@users.noreply.github.com>
1 parent 2d5d2c2 commit 62a24f3

File tree

19 files changed

+316
-37
lines changed

19 files changed

+316
-37
lines changed
Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
# Accessibility
22

3+
The [dark], [sans_dark], [blueberry], [lightyear], and [red_drum] color palettes meet WCAG 2.1 AA color contrast standards.
4+
5+
The [default], [sans], [pink], and [gruvbox_dark] color palettes currently have the contrast issues noted below. These palettes will be updated in the next major release and their current settings moved to a legacy version.
6+
7+
[default]: ../configuration/palettes/default/
8+
[sans]: ../configuration/palettes/sans/
9+
[pink]: ../configuration/palettes/pink/
10+
[gruvbox_dark]: ../configuration/palettes/gruvbox-dark/
11+
[dark]: ../configuration/palettes/dark/
12+
[sans_dark]: ../configuration/palettes/sans-dark/
13+
[blueberry]: ../configuration/palettes/blueberry/
14+
[lightyear]: ../configuration/palettes/lightyear/
15+
[red_drum]: ../configuration/palettes/red-drum/
16+
317
## Known Issues
418

519
### Color Contrast
620

7-
| Palette | Primary Links | Buttons | Code Blocks |
8-
| ------------ | ------------- | ------- | ----------- |
9-
| [default](../configuration/palettes/default/) | x | x | |
10-
| [sans](../configuration/palettes/sans/) | x | x | |
11-
| [pink](../configuration/palettes/pink/) | x | x | |
12-
| [gruvbox_dark](../configuration/palettes/gruvbox-dark/) | | x | |
13-
| [dark](../configuration/palettes/dark/) | | | |
14-
| [sans_dark](../configuration/palettes/sans-dark/) | | | |
21+
| Palette | Primary Links | Buttons | Code Blocks |
22+
| -------------- | ------------- | ------- | ----------- |
23+
| [default] | x | x | |
24+
| [sans] | x | x | |
25+
| [pink] | x | x | |
26+
| [gruvbox_dark] | | x | |
27+
| [dark] | | | |
28+
| [sans_dark] | | | |
29+
| [blueberry] | | | |
30+
| [lightyear] | | | |
31+
| [red_drum] | | | |
1532

16-
'x' indicates an open WCAG 2.1 AA contrast failure detected by the [test_color_contrast.py] integration test.
33+
'x' indicates an open WCAG 2.1 AA contrast failure detected by the [test_color_contrast.py] integration test.
1734

1835
See [Color Contrast Failures](#color-contrast-failures) for the measured ratios and affected components.
1936

20-
Future releases of the Terminal for MkDocs theme will include palettes which meet WCAG 2.1 AA contrast standards. To track progress, see issue [#119](https://github.com/ntno/mkdocs-terminal/issues/119).
21-
22-
2337
[test_color_contrast.py]: https://github.com/ntno/mkdocs-terminal/blob/main/tests/accessibility/test_color_contrast.py
2438

2539
#### Color Contrast Failures
@@ -29,27 +43,33 @@ Ratios and RGB hex pairs come from the January 25 2026 run of [tests/accessibi
2943
Expected contrast for all combinations is `4.5 : 1`
3044

3145
##### default
32-
- Primary links (#1a95e0 on #ffffff) measure `3.27 : 1`
33-
- Primary buttons (#ffffff text on #1a95e0 background) also measure `3.27 : 1`
46+
47+
- Primary links (#1a95e0 on #ffffff) measure `3.27 : 1`
48+
- Primary buttons (#ffffff text on #1a95e0 background) also measure `3.27 : 1`
3449

3550
##### dark
51+
3652
- No open contrast failures as of January 25 2026.
3753

3854
##### gruvbox_dark
55+
3956
- Alert message accents (#fb4934 on #282828) measure `4.29 : 1`
40-
- Ghost error buttons (#fb4934 text on #282828 background) also measure `4.29 : 1`
57+
- Ghost error buttons (#fb4934 text on #282828 background) also measure `4.29 : 1`
4158

4259
##### pink
43-
- Primary links (#f90d7a on #ffffff) measure `3.91 : 1`
44-
- Primary buttons (#f7f7f7 on #f90d7a) measure `3.65 : 1`
60+
61+
- Primary links (#f90d7a on #ffffff) measure `3.91 : 1`
62+
- Primary buttons (#f7f7f7 on #f90d7a) measure `3.65 : 1`
4563

4664
##### sans
65+
4766
- Primary links (#1a95e0 on #ffffff) measure `3.27 : 1 `
48-
- Primary buttons (#ffffff on #1a95e0) measure `3.27 : 1`
67+
- Primary buttons (#ffffff on #1a95e0) measure `3.27 : 1`
4968

5069
##### sans_dark
70+
5171
- No open contrast failures as of January 25 2026.
5272

5373
## Report An Issue
5474

55-
To report an issue, please create a new issue in the GitHub repository: [mkdocs-terminal > Create new issue](https://github.com/ntno/mkdocs-terminal/issues/new/choose)
75+
To report an issue, please create a new issue in the GitHub repository: [mkdocs-terminal > Create new issue](https://github.com/ntno/mkdocs-terminal/issues/new/choose)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
show_tiles_inline: true
3+
tiles:
4+
- caption: '@petradr'
5+
img_src: ../../../img/picsum/167_200x200.jpeg
6+
tooltip: 'to Picsum homepage'
7+
alt_text: 'Picsum Photo API.'
8+
link_href: https://picsum.photos/
9+
- caption: 'Marcin Czerwinski'
10+
img_src: ../../../img/picsum/127_200x200.jpeg
11+
tooltip: 'to Picsum homepage'
12+
alt_text: 'Picsum Photo API.'
13+
link_href: https://picsum.photos/
14+
- caption: "Steve Richey"
15+
img_src: ../../../img/picsum/143_200x200.jpeg
16+
tooltip: 'to Picsum homepage'
17+
alt_text: 'Picsum Photo API.'
18+
link_href: https://picsum.photos/
19+
---
20+
21+
--8<--
22+
configuration/palettes/links.md
23+
--8<--
24+
25+
# Blueberry Palette
26+
27+
To use the blueberry palette, add the `palette` attribute to your theme configuration in `mkdocs.yml`:
28+
29+
```yaml
30+
theme:
31+
name: terminal
32+
palette: blueberry
33+
```
34+
35+
<link href="../../../css/palettes/blueberry.css" rel="stylesheet">
36+
37+
--8<--
38+
elements/examples/index.md
39+
--8<--
40+
41+
## Tile Grid Example
42+
{{ tile_grid(page.meta) }}
43+
44+
<br>

documentation/docs/configuration/palettes/index.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,58 @@ tiles:
66
tooltip: to Default Demo Page
77
alt_text: Default Demo Page
88
link_href: ./default/
9-
- caption: <a id="fnref:2" class="footnote-ref" title="to image description" alt="to Gruvbox Dark palette description." href="#fn:2">Gruvbox Dark</a>
9+
- caption: <a id="fnref:2" class="footnote-ref" title="to image description" alt="to Blueberry palette description." href="#fn:2">Blueberry</a>
10+
img_src: ../../img/palettes/blueberry.png
11+
tooltip: to Blueberry Demo Page
12+
alt_text: Blueberry Demo Page
13+
link_href: ./blueberry/
14+
- caption: <a id="fnref:3" class="footnote-ref" title="to image description" alt="to Gruvbox Dark palette description." href="#fn:3">Gruvbox Dark</a>
1015
img_src: ../../img/palettes/gruvbox_dark.png
1116
tooltip: to Gruvbox Dark Demo Page
1217
alt_text: Gruvbox Dark Demo Page
1318
link_href: ./gruvbox-dark/
14-
- caption: <a id="fnref:3" class="footnote-ref" title="to image description" alt="to Dark palette description." href="#fn:3">Dark</a>
19+
- caption: <a id="fnref:4" class="footnote-ref" title="to image description" alt="to Dark palette description." href="#fn:4">Dark</a>
1520
img_src: ../../img/palettes/dark.png
1621
tooltip: to Dark Demo Page
1722
alt_text: Dark Demo Page
18-
link_href: ./dark/
19-
- caption: <a id="fnref:4" class="footnote-ref" title="to image description" alt="to Pink palette description." href="#fn:4">Pink</a>
23+
link_href: ./dark/
24+
- caption: <a id="fnref:5" class="footnote-ref" title="to image description" alt="to Lightyear palette description." href="#fn:5">Lightyear</a>
25+
img_src: ../../img/palettes/lightyear.png
26+
tooltip: to Lightyear Demo Page
27+
alt_text: Lightyear Demo Page
28+
link_href: ./lightyear/
29+
- caption: <a id="fnref:6" class="footnote-ref" title="to image description" alt="to Pink palette description." href="#fn:6">Pink</a>
2030
img_src: ../../img/palettes/pink.png
2131
tooltip: to Pink Demo Page
2232
alt_text: Pink Demo Page
2333
link_href: ./pink/
24-
- caption: <a id="fnref:5" class="footnote-ref" title="to image description" alt="to Sans palette description." href="#fn:5">Sans</a>
34+
- caption: <a id="fnref:7" class="footnote-ref" title="to image description" alt="to Red Drum palette description." href="#fn:7">Red Drum</a>
35+
img_src: ../../img/palettes/red_drum.png
36+
tooltip: to Red Drum Demo Page
37+
alt_text: Red Drum Demo Page
38+
link_href: ./red-drum/
39+
- caption: <a id="fnref:8" class="footnote-ref" title="to image description" alt="to Sans palette description." href="#fn:8">Sans</a>
2540
img_src: ../../img/palettes/sans.png
2641
tooltip: to Sans Demo Page
2742
alt_text: Sans Demo Page
2843
link_href: ./sans/
29-
- caption: <a id="fnref:6" class="footnote-ref" title="to image description" alt="to Sans Dark palette description." href="#fn:6">Sans Dark</a>
44+
- caption: <a id="fnref:9" class="footnote-ref" title="to image description" alt="to Sans Dark palette description." href="#fn:9">Sans Dark</a>
3045
img_src: ../../img/palettes/sans_dark.png
3146
tooltip: to Sans Dark Demo Page
3247
alt_text: Sans Dark Demo Page
33-
link_href: ./sans-dark/
48+
link_href: ./sans-dark/
3449
---
3550

3651
# Theme Color Palettes
3752
Terminal for MkDocs supports the following color palettes by default:
3853

3954
- [default](default.md)
55+
- [blueberry](blueberry.md)
4056
- [gruvbox_dark](gruvbox-dark.md)
4157
- [dark](dark.md)
58+
- [lightyear](lightyear.md)
4259
- [pink](pink.md)
60+
- [red_drum](red-drum.md)
4361
- [sans](sans.md)
4462
- [sans_dark](sans-dark.md)
4563

@@ -52,8 +70,11 @@ theme:
5270
```
5371
5472
[^1]: white background and light blue hyperlinks.
55-
[^2]: dark grey background, orange hyperlinks, and light yellow text.
56-
[^3]: black background, light blue hyperlinks, and white text.
57-
[^4]: white background and pink hyperlinks.
58-
[^5]: white background, light blue hyperlinks, and sans font.
59-
[^6]: black background, light blue hyperlinks, and white text in sans font.
73+
[^2]: cream background and navy blue hyperlinks
74+
[^3]: dark grey background, orange hyperlinks, and light yellow text.
75+
[^4]: black background, light blue hyperlinks, and white text.
76+
[^5]: light green background and indigo hyperlinks
77+
[^6]: white background and pink hyperlinks.
78+
[^7]: beige background and brown hyperlinks.
79+
[^8]: white background, light blue hyperlinks, and sans font.
80+
[^9]: black background, light blue hyperlinks, and white text in sans font.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
show_tiles_inline: true
3+
tiles:
4+
- caption: '@petradr'
5+
img_src: ../../../img/picsum/167_200x200.jpeg
6+
tooltip: 'to Picsum homepage'
7+
alt_text: 'Picsum Photo API.'
8+
link_href: https://picsum.photos/
9+
- caption: 'Marcin Czerwinski'
10+
img_src: ../../../img/picsum/127_200x200.jpeg
11+
tooltip: 'to Picsum homepage'
12+
alt_text: 'Picsum Photo API.'
13+
link_href: https://picsum.photos/
14+
- caption: "Steve Richey"
15+
img_src: ../../../img/picsum/143_200x200.jpeg
16+
tooltip: 'to Picsum homepage'
17+
alt_text: 'Picsum Photo API.'
18+
link_href: https://picsum.photos/
19+
---
20+
21+
--8<--
22+
configuration/palettes/links.md
23+
--8<--
24+
25+
# Lightyear Palette
26+
27+
To use the lightyear color palette, add the `palette` attribute to your theme configuration in `mkdocs.yml`:
28+
29+
```yaml
30+
theme:
31+
name: terminal
32+
palette: lightyear
33+
```
34+
35+
<link href="../../../css/palettes/lightyear.css" rel="stylesheet">
36+
37+
--8<--
38+
elements/examples/index.md
39+
--8<--
40+
41+
## Tile Grid Example
42+
{{ tile_grid(page.meta) }}
43+
44+
<br>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<nav class="terminal-mkdocs-pad-to-match-side-nav" markdown>
22
[Default](default.md) |
3+
[Blueberry](blueberry.md) |
34
[Gruvbox Dark](gruvbox-dark.md) |
45
[Dark](dark.md) |
6+
[Lightyear](lightyear.md) |
57
[Pink](pink.md) |
8+
[Red Drum](red-drum.md) |
69
[Sans](sans.md) |
710
[Sans Dark](sans-dark.md)
811
</nav>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
show_tiles_inline: true
3+
tiles:
4+
- caption: '@petradr'
5+
img_src: ../../../img/picsum/167_200x200.jpeg
6+
tooltip: 'to Picsum homepage'
7+
alt_text: 'Picsum Photo API.'
8+
link_href: https://picsum.photos/
9+
- caption: 'Marcin Czerwinski'
10+
img_src: ../../../img/picsum/127_200x200.jpeg
11+
tooltip: 'to Picsum homepage'
12+
alt_text: 'Picsum Photo API.'
13+
link_href: https://picsum.photos/
14+
- caption: "Steve Richey"
15+
img_src: ../../../img/picsum/143_200x200.jpeg
16+
tooltip: 'to Picsum homepage'
17+
alt_text: 'Picsum Photo API.'
18+
link_href: https://picsum.photos/
19+
---
20+
21+
--8<--
22+
configuration/palettes/links.md
23+
--8<--
24+
25+
# Red Drum Palette
26+
27+
To use the red_drum color palette, add the `palette` attribute to your theme configuration in `mkdocs.yml`:
28+
29+
```yaml
30+
theme:
31+
name: terminal
32+
palette: red_drum
33+
```
34+
35+
<link href="../../../css/palettes/red_drum.css" rel="stylesheet">
36+
37+
--8<--
38+
elements/examples/index.md
39+
--8<--
40+
41+
## Tile Grid Example
42+
{{ tile_grid(page.meta) }}
43+
44+
<br>
394 KB
Loading
399 KB
Loading
390 KB
Loading

documentation/docs/releases.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ See [Version Identification and Dependency Specification] for additional constra
2424

2525
| Release | Theme Status | Supported? |
2626
| :-----: | :----------: | :--------: |
27+
| [4.8.0] | Beta | yes |
2728
| [4.7.0] | Beta | yes |
2829
| [4.3.0] | Beta | yes |
2930
| [4.1.0] | Beta | yes |
@@ -34,6 +35,7 @@ See [Version Identification and Dependency Specification] for additional constra
3435

3536

3637
<br>
38+
[4.8.0]: https://github.com/ntno/mkdocs-terminal/releases/tag/4.8.0
3739
[4.7.0]: https://github.com/ntno/mkdocs-terminal/releases/tag/4.7.0
3840
[4.3.0]: https://github.com/ntno/mkdocs-terminal/releases/tag/4.3.0
3941
[4.1.0]: https://github.com/ntno/mkdocs-terminal/releases/tag/4.1.0

0 commit comments

Comments
 (0)