mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-16 06:13:32 -06:00
Compare commits
1 Commits
v0.10.0
...
code-block
Author | SHA1 | Date | |
---|---|---|---|
|
b1e3394593 |
@@ -566,8 +566,17 @@ jtd.onReady(function(){
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Copy button on code
|
// Accessibility: set tabindex=0 on each code highlight block, so screenreaders
|
||||||
|
// can focus over (particularly important if there's horizontal scroll)
|
||||||
|
// see: https://dequeuniversity.com/rules/axe/4.9/scrollable-region-focusable?application=axeAPI
|
||||||
|
|
||||||
|
jtd.onReady(() => {
|
||||||
|
document
|
||||||
|
.querySelectorAll("div.highlight")
|
||||||
|
.forEach(codeBlock => codeBlock.setAttribute("tabindex", "0"));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Copy button on code
|
||||||
|
|
||||||
{%- if site.enable_copy_code_button != false %}
|
{%- if site.enable_copy_code_button != false %}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user