Skip to content

Commit

Permalink
Accessibility fixes for generated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Humphrey committed Jun 12, 2022
1 parent 31c9512 commit 87a6595
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
18 changes: 18 additions & 0 deletions src/themes/default/stylesheets/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ $text-color: black !default;
}
}

@mixin visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

#spectaql {
padding: 0;
margin: 0;
Expand Down Expand Up @@ -166,10 +178,16 @@ $text-color: black !default;
box-shadow: 0 5px 0 $text-color, 0 10px 0 $text-color;
}
}
.sr-only {
@include visually-hidden();
}
}

.close-button {
display: block;
.sr-only {
@include visually-hidden();
}

@media (min-width: $size-sidebar-break) {
display: none;
Expand Down
6 changes: 3 additions & 3 deletions src/themes/default/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ $background-arguments: #fafbfc;
.sidebar-open-button {
&::after {
display: block;
content: "All Topics";
content: "All topics";
margin-left: math.div($content-padding, 2);
color: $text-color;
}
Expand Down Expand Up @@ -308,7 +308,7 @@ $background-arguments: #fafbfc;
margin-top: $content-padding;

.example-heading {
display: none;
@include visually-hidden();
}

// The heading above each code example block
Expand Down Expand Up @@ -387,7 +387,7 @@ $background-arguments: #fafbfc;
.operation-description > h5,
.definition-description > h5,
.definition-properties > h5 {
display: none;
@include visually-hidden();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<div id="mobile-navbar">
<button class="sidebar-open-button" type="button">
<span class="hamburger"></span>
<span class="sr-only">All topics</span>
</button>
</div>
3 changes: 2 additions & 1 deletion src/themes/default/views/partials/layout/page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<img src="images/{{logo}}" title="{{info.title}}" />
{{/if}}
</div>
<button class="close-button" aria-label="Close menu" type="button">
<button class="close-button" type="button">
<span aria-hidden="true">×</span>
<span class="sr-only">Close menu</span>
</button>
</div>
{{>layout/nav/main}}
Expand Down

0 comments on commit 87a6595

Please sign in to comment.