Skip to content

Commit 183dcf3

Browse files
committed
fix(a11y): fix contrast of keyboard shortcut labels
kbd elements inherit the red code text color (#e74c3c), which gives ~3.82:1 against white — below the 4.5:1 required for normal text (WCAG 1.4.3 / BITV 9.1.4.3). The light border (#a6a6a6) also falls short of the 3:1 required for UI component boundaries (WCAG 1.4.11). Override text color to #c0392b (~5.4:1) and border to #767676 (~4.5:1). Fixes #9675 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent c5c2990 commit 183dcf3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

_shared_assets/static/custom.css

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

68+
/* kbd elements pick up the red code text color (#e74c3c) which gives
69+
~3.82:1 on white — below the 4.5:1 required by WCAG AA / BITV 9.1.4.3.
70+
Override to a darker red (~5.4:1) and darken the border so the
71+
key outline meets the 3:1 non-text contrast requirement. */
72+
.rst-content kbd,
73+
kbd {
74+
color: #c0392b;
75+
border-color: #767676;
76+
}
77+
6878
/* Fix code within tables - remove too big margins */
6979
.rst-content td {
7080
div[class^="highlight"]:last-of-type,

0 commit comments

Comments
 (0)