Skip to content

Commit

Permalink
[website] a11y fixes (facebook#10927)
Browse files Browse the repository at this point in the history
* [Gatsby docs a11y] Add `aria-label` to search input

**what is the change?:**
See title.

**why make this change?:**
There was no label on this input, and screen readers might not have been
able to identify it's purpose.
[The `placeholder` doesn't count as a label.](http://a11yproject.com/posts/placeholder-input-elements/)

**test plan:**
Manually inspected the HTML in the devtools, and ran the aXe a11y audit
tool, and the warning generated by aXe was gone.

**issue:**
Checklist item on list of docs a11y issues -
https://github.com/bvaughn/react/wiki/Gatsby-A11y-Fixes

* [Gatsby Docs a11y] Increase contrast of 'installation' page tabs

**what is the change?:**
Change the dark blue used for the text/background of the tabs on the
'installation' page to a slightly darker blue, which we were already
using for the 'focus' style of the tabs. It looked a bit weird before,
imo, when the 'focus' was darker.

Now the 'focus' style just lightens the border to the new signature
blue.

**why make this change?:**

To add enough contrast that folks who see colors differently can still
decipher the writing on the tabs on this page.

We plan to refactor this page and remove the tabs soon, so not too
worried about making this fix perfect.

**test plan:**
Manual testing - loaded the page and it looks ok, and ran aXe a11y
audit, no more warnings about contrast. :)

(Flarnie will insert a screenshot)

**issue:**
checklist item on https://github.com/bvaughn/react/wiki/Gatsby-A11y-Fixes
  • Loading branch information
flarnie authored Sep 28, 2017
1 parent 83a536e commit ca7bea8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ React is flexible and can be used in a variety of projects. You can create new a
top: 1px;
padding: 10px;
margin: 0px 2px 0px 2px;
border: 1px solid #05A5D1;
border: 1px solid #046E8B;
border-bottom-color: transparent;
border-radius: 3px 3px 0px 0px;
color: #05A5D1;
color: #046E8B;
background-color: transparent;
font-size: 0.99em;
cursor: pointer;
Expand All @@ -45,15 +45,15 @@ React is flexible and can be used in a variety of projects. You can create new a
display: inline-block;
list-style-type: none;
margin: 0;
border-bottom: 1px solid #05A5D1;
border-bottom: 1px solid #046E8B;
cursor: default;
}
@media screen and (max-width: 960px) {
.toggler li,
.toggler li:first-child,
.toggler li:last-child {
display: block;
border-bottom-color: #05A5D1;
border-bottom-color: #046E8B;
border-radius: 3px;
margin: 2px 0px 2px 0px;
}
Expand All @@ -64,13 +64,13 @@ React is flexible and can be used in a variety of projects. You can create new a
.display-target-fiddle .toggler .button-fiddle:focus,
.display-target-newapp .toggler .button-newapp:focus,
.display-target-existingapp .toggler .button-existingapp:focus {
background-color: #046E8B;
border: solid 1px #61dafb;;
color: white;
}
.display-target-fiddle .toggler .button-fiddle,
.display-target-newapp .toggler .button-newapp,
.display-target-existingapp .toggler .button-existingapp {
background-color: #05A5D1;
background-color: #046E8B;
color: white;
}
section {
Expand Down
1 change: 1 addition & 0 deletions www/src/components/LayoutHeader/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const Header = ({location}) => (
id="algolia-doc-search"
type="search"
placeholder="Search docs"
aria-label="Search docs"
/>
</form>

Expand Down

0 comments on commit ca7bea8

Please sign in to comment.