Skip to content

Commit

Permalink
Add basic accessibility fixes (#2215)
Browse files Browse the repository at this point in the history
* Add basic accessibility fixes

* Fix ALT text in tutorial part 4
  • Loading branch information
theanxy authored and KyleAMathews committed Sep 25, 2017
1 parent d683ae8 commit 3d05848
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/docs/adding-images-fonts-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ render() {
// Note: this is an escape hatch and should be used sparingly!
// Normally we recommend using `import` for getting asset URLs
// as described in “Adding Images and Fonts” above this section.
return <img src={__PATH_PREFIX__ + '/img/logo.png'} />;
return <img src={__PATH_PREFIX__ + '/img/logo.png'} alt="Logo" />;
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GATSBY_ASSETS_URL=http://s3.amazonaws.com/bucketname
render() {
return (
<div>
<img src={`${process.env.GATSBY_ASSETS_URL}/logo.png`} />
<img src={`${process.env.GATSBY_ASSETS_URL}/logo.png`} alt="Logo" />
</div>
)
}
Expand Down
5 changes: 4 additions & 1 deletion docs/tutorial/part-four/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export default () =>
<div>
<h1>Amazing Pandas Eating Things</h1>
<div>
<img src="https://2.bp.blogspot.com/-BMP2l6Hwvp4/TiAxeGx4CTI/AAAAAAAAD_M/XlC_mY3SoEw/s1600/panda-group-eating-bamboo.jpg" />
<img
src="https://2.bp.blogspot.com/-BMP2l6Hwvp4/TiAxeGx4CTI/AAAAAAAAD_M/XlC_mY3SoEw/s1600/panda-group-eating-bamboo.jpg"
alt="Group of pandas eating bamboo"
/>
</div>
</div>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/part-one/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default () =>
<div style={{ color: `tomato` }}>
<h1>Hello Gatsby!</h1>
<p>What a world.</p>
<img src="http://lorempixel.com/400/200/" />
<img src="http://lorempixel.com/400/200/" alt="" />
</div>
```

Expand All @@ -133,7 +133,7 @@ export default () =>
<div style={{ color: `tomato` }}>
<h1>Hello Gatsby!</h1>
<p>What a world.</p>
<img src="http://lorempixel.com/400/200/" />
<img src="http://lorempixel.com/400/200/" alt="" />
<br />
<Link to="/page-2/">Link</Link>
</div>
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorial/part-two/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ import Container from "../components/container"
const User = props =>
<div className={styles.user}>
<img src={props.avatar} className={styles.avatar} />
<img src={props.avatar} className={styles.avatar} alt="" />
<div className={styles.description}>
<h2 className={styles.username}>
{props.username}
Expand Down Expand Up @@ -475,6 +475,7 @@ const User = props =>
<img
src={props.avatar}
css={{ flex: `0 0 96px`, width: 96, height: 96, margin: 0 }}
alt=""
/>
<div css={{ flex: 1, marginLeft: 18, padding: 12 }}>
<h2 css={{ margin: `0 0 12px 0`, padding: 0 }}>
Expand Down Expand Up @@ -574,7 +575,7 @@ const Excerpt = styled.p`margin: 0;`

const User = props =>
<UserWrapper>
<Avatar src={props.avatar} />
<Avatar src={props.avatar} alt="" />
<Description>
<Username>
{props.username}
Expand Down
1 change: 1 addition & 0 deletions examples/using-contentful/src/templates/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class CategoryTemplate extends React.Component {
}}
src={iconImg.src}
srcSet={iconImg.srcSet}
alt=""
/>
<h4 style={{ marginBottom: 0 }}>{title}</h4>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You aren't just limited to markdown image tags either. You can either use markdo
Or HTML image tags:

```
&lt;img src="image.png"&gt;
&lt;img src="image.png" alt=""&gt;
```

Let's see some more photos by [Max Boettinger](https://unsplash.com/@maxboettinger) ([I](https://unsplash.com/photos/T7Lnl3PFISM), [II](https://unsplash.com/@maxboettinger?photo=SUFS6CPjB5Q)):
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/blog-post-preview-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class BlogPostPreviewItem extends React.Component {
}}
>
<img
alt={`Avatar for ${post.frontmatter.author.id}`}
alt=""
src={avatar.src}
srcSet={avatar.srcSet}
height={avatar.height}
Expand Down
1 change: 1 addition & 0 deletions www/src/components/diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const Gatsby = ({ children }) => (
margin: 0,
verticalAlign: `middle`,
}}
alt=""
/>
<ItemDescription>
<small
Expand Down
2 changes: 2 additions & 0 deletions www/src/components/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default ({ pathname }) => {

return (
<div
role="navigation"
css={{
borderBottom: `1px solid ${presets.veryLightPurple}`,
backgroundColor: `rgba(255,255,255,0.975)`,
Expand Down Expand Up @@ -133,6 +134,7 @@ export default ({ pathname }) => {
marginRight: rhythm(2 / 4),
verticalAlign: `middle`,
}}
alt=""
/>
<h1
css={{
Expand Down

0 comments on commit 3d05848

Please sign in to comment.