Skip to content

Commit

Permalink
Merge pull request #33 from mlibrary/scrollable-focus
Browse files Browse the repository at this point in the history
Add tabindex to code blocks so they can be scrolled with kb
  • Loading branch information
bridgetburke authored May 24, 2024
2 parents 6c96719 + 7ff5828 commit 09f1206
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/transforms/docs-color-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module.exports = function (el) {
// add a class to the `<pre>` tag for easier styling
// could remove once we're convinced we can rely on pre:has(code)
el.parentElement.classList.add('code');
el.setAttribute("tabindex", "0");
el.setAttribute("role", "figure");
el.setAttribute("aria-label", "Code to be copied");
}
}
}

0 comments on commit 09f1206

Please sign in to comment.