Skip to content

Commit 4dac30d

Browse files
committed
make toolbar accessible
1 parent 172e374 commit 4dac30d

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

shared/components/Preview/PreviewFrame.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import ReactDOM from 'react-dom';
33

44
class PreviewFrame extends React.Component {
5-
5+
66
componentDidMount() {
77
if (this.props.isPlaying) {
88
this.renderFrameContents();
@@ -57,8 +57,8 @@ class PreviewFrame extends React.Component {
5757
}
5858

5959
render() {
60-
return <iframe className="preview-frame" frameBorder="0" sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms"></iframe>;
60+
return <iframe className="preview-frame" frameBorder="0" sandbox="allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms" title="sketch output"></iframe>;
6161
}
6262
}
6363

64-
export default PreviewFrame;
64+
export default PreviewFrame;

shared/components/Toolbar/Toolbar.jsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,23 @@ class Toolbar extends React.Component {
1212
"toolbar__play-button": true,
1313
"playing": this.props.isPlaying
1414
});
15+
let stopButtonClass = classNames({
16+
"toolbar__stop-button": true,
17+
"stopped": !this.props.isPlaying
18+
});
1519

1620
return (
1721
<div className="toolbar">
1822
<img className="toolbar__logo" src={logoUrl}/>
19-
<div className={playButtonClass} onClick={this.props.startSketch}>
23+
<button className={playButtonClass} onClick={this.props.startSketch}>
2024
<Isvg src={playUrl} alt="Play Sketch" />
21-
</div>
22-
{ this.props.isPlaying ?
23-
<div className="toolbar__stop-button" onClick={this.props.stopSketch}>
24-
<Isvg src={stopUrl} alt="Stop Sketch" />
25-
</div>
26-
: null }
25+
</button>
26+
<button className={stopButtonClass} onClick={this.props.stopSketch}>
27+
<Isvg src={stopUrl} alt="Stop Sketch" />
28+
</button>
2729
</div>
2830
);
2931
}
3032
}
3133

32-
export default Toolbar;
34+
export default Toolbar;

styles/abstracts/_placeholders.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
width: #{44 / $base-font-size}rem;
77
text-align: center;
88
border-radius: 100%;
9-
109
line-height: #{50 / $base-font-size}rem;
1110
cursor: pointer;
11+
border: none;
1212

1313
& g {
1414
fill: $light-toolbar-button-color;
@@ -22,4 +22,4 @@
2222
fill: $light-button-hover-color;
2323
}
2424
}
25-
}
25+
}

styles/components/_toolbar.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212
.toolbar__stop-button {
1313
@extend %toolbar-button;
14+
&.stopped {
15+
background-color: $light-button-background-hover-color;
16+
& g {
17+
fill: $light-button-hover-color;
18+
}
19+
}
1420
}
1521

1622
.toolbar__logo {
@@ -20,4 +26,4 @@
2026
.toolbar {
2127
padding: #{20 / $base-font-size}rem #{60 / $base-font-size}rem;
2228
display: flex;
23-
}
29+
}

0 commit comments

Comments
 (0)