Skip to content

Commit eb2a09e

Browse files
committed
fix(a11y): fix contrast of inline code text
RTD theme renders inline code in #e74c3c on a white background, yielding a contrast ratio of ~3.82:1. WCAG AA / BITV 9.1.4.3 requires 4.5:1 for normal-weight text. Switching to #c0392b (darker red) raises the ratio to ~5.4:1. Fixes #9677 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent c5c2990 commit eb2a09e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

_shared_assets/static/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ h6 {
6565
background: rgba(0, 130, 201, 0.1)
6666
}
6767

68+
/* Inline code — RTD uses #e74c3c on white which gives ~3.82:1, below
69+
the 4.5:1 required by WCAG AA / BITV 9.1.4.3. Use a darker shade. */
70+
.rst-content code,
71+
.rst-content tt,
72+
code {
73+
color: #c0392b;
74+
}
75+
6876
/* Fix code within tables - remove too big margins */
6977
.rst-content td {
7078
div[class^="highlight"]:last-of-type,

0 commit comments

Comments
 (0)