Skip to content

Commit

Permalink
Feat: Improve accessibility (styleguidist#893)
Browse files Browse the repository at this point in the history
  • Loading branch information
gergely-nagy authored and sapegin committed Mar 29, 2018
1 parent e3e2112 commit 692e8af
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ export function TableOfContentsRenderer({ classes, children, searchTerm, onSearc
value={searchTerm}
className={classes.input}
placeholder="Filter by name"
aria-label="Filter by name"
onChange={event => onSearchTermChange(event.target.value)}
/>
</div>
{children}
<nav>{children}</nav>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ exports[`renderer should render table of contents 1`] = `
<div>
<div>
<input
aria-label="Filter by name"
onChange={[Function]}
placeholder="Filter by name"
value="foo"
/>
</div>
<nav />
</div>
</div>
`;
Expand Down
4 changes: 2 additions & 2 deletions src/rsg-components/ToolbarButton/ToolbarButtonRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ export function ToolbarButtonRenderer({

if (href !== undefined) {
return (
<a href={href} title={title} className={classNames}>
<a href={href} title={title} className={classNames} aria-label={title}>
{children}
</a>
);
}

return (
<button type="button" onClick={onClick} title={title} className={classNames}>
<button type="button" onClick={onClick} title={title} className={classNames} aria-label={title}>
{children}
</button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`should render a button 1`] = `
<button
aria-label="Pizza button"
className="button"
onClick={[Function]}
title="Pizza button"
Expand All @@ -13,6 +14,7 @@ exports[`should render a button 1`] = `

exports[`should render a link 1`] = `
<a
aria-label="Pizza button"
className="button"
href="/foo"
title="Pizza button"
Expand Down
2 changes: 1 addition & 1 deletion src/styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const space = [

export const color = {
base: '#333',
light: '#999',
light: '#767676',
lightest: '#ccc',
link: '#1978c8',
linkHover: '#f28a25',
Expand Down

0 comments on commit 692e8af

Please sign in to comment.