Skip to content

Commit da23720

Browse files
committed
fix(a11y): make the code copy tooltip readable
sphinx-copybutton draws its "Copy" and "Copied!" tooltip white on grey #808080 at 0.8em, a contrast of 3.95:1, under the 4.5:1 WCAG asks for text of that size, so low vision readers cannot confirm the copy.
1 parent e5f1309 commit da23720

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎_static/copy-button.css‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@
1717
.highlight button.copybtn {
1818
scroll-margin-top: 4.1rem;
1919
}
20+
21+
/* The "Copy" and "Copied!" tooltip of sphinx-copybutton is white on
22+
grey #808080 at 0.8em, a contrast of 3.95:1, under the 4.5:1 that
23+
text of this size needs. Draw it on the page text color, about
24+
11:1. */
25+
.highlight button.copybtn::after {
26+
background: #2c3e50;
27+
}

0 commit comments

Comments
 (0)