Skip to content

Commit

Permalink
Rollup merge of rust-lang#82584 - tazjin:rustdoc-aria, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Add ARIA role to sidebar toggle in Rustdoc

This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies.

Example of Vimium after this change has been applied (see the issue mentioned below for a screenshot of before):

![Screenshot of Vimium link hints on a Rustdoc page, indicating that the sidebar toggle is clickable](https://user-images.githubusercontent.com/1552853/109384961-ff935400-78f8-11eb-8199-1d35181aeff0.png)

Fixes rust-lang#82582
  • Loading branch information
Dylan-DPC authored Feb 27, 2021
2 parents d14b18e + e026e18 commit 97fd561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ crate fn render<T: Print, S: Print>(
<![endif]-->\
{before_content}\
<nav class=\"sidebar\">\
<div class=\"sidebar-menu\">&#9776;</div>\
<div class=\"sidebar-menu\" role=\"button\">&#9776;</div>\
{logo}\
{sidebar}\
</nav>\
Expand Down

0 comments on commit 97fd561

Please sign in to comment.