mirror of
https://github.com/mastodon/mastodon
synced 2024-12-01 00:08:21 +09:00
a11y: Improve icon button component regarding semantics and screen reader usage
This commit is contained in:
parent
77045d0886
commit
87aabeb7af
@ -35,9 +35,9 @@ const IconButton = React.createClass({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a href='#' title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={style}>
|
<button aria-label={this.props.title} title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={style}>
|
||||||
<i className={`fa fa-fw fa-${this.props.icon}`}></i>
|
<i className={`fa fa-fw fa-${this.props.icon}`} aria-hidden='true'></i>
|
||||||
</a>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,8 @@
|
|||||||
|
|
||||||
.icon-button {
|
.icon-button {
|
||||||
color: #616b86;
|
color: #616b86;
|
||||||
cursor: pointer;
|
border: none;
|
||||||
|
background: transparent;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #717b98;
|
color: #717b98;
|
||||||
|
Loading…
Reference in New Issue
Block a user