Merge branch 'styles-accessibility' into 'develop'
Minor accessibility improvements See merge request soapbox-pub/soapbox-fe!578
This commit is contained in:
commit
76a556cdeb
11 changed files with 35 additions and 12 deletions
|
@ -4,6 +4,7 @@ exports[`<ColumnBackButton /> renders correctly 1`] = `
|
||||||
<button
|
<button
|
||||||
className="column-back-button"
|
className="column-back-button"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
|
onKeyUp={[Function]}
|
||||||
>
|
>
|
||||||
<i
|
<i
|
||||||
alt="chevron-left"
|
alt="chevron-left"
|
||||||
|
|
|
@ -7,6 +7,7 @@ exports[`<ColumnBackButtonSlim /> renders correctly 1`] = `
|
||||||
<div
|
<div
|
||||||
className="column-back-button column-back-button--slim-button"
|
className="column-back-button column-back-button--slim-button"
|
||||||
onClick={[Function]}
|
onClick={[Function]}
|
||||||
|
onKeyUp={[Function]}
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex="0"
|
tabIndex="0"
|
||||||
>
|
>
|
||||||
|
|
|
@ -17,9 +17,15 @@ export default class ColumnBackButton extends React.PureComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleKeyUp = (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
this.handleClick();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<button onClick={this.handleClick} className='column-back-button'>
|
<button onClick={this.handleClick} onKeyUp={this.handleKeyUp} className='column-back-button'>
|
||||||
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
||||||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default class ColumnBackButtonSlim extends ColumnBackButton {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className='column-back-button--slim'>
|
<div className='column-back-button--slim'>
|
||||||
<div role='button' tabIndex='0' onClick={this.handleClick} className='column-back-button column-back-button--slim-button'>
|
<div role='button' tabIndex='0' onClick={this.handleClick} onKeyUp={this.handleKeyUp} className='column-back-button column-back-button--slim-button'>
|
||||||
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
<Icon id='chevron-left' className='column-back-button__icon' fixedWidth />
|
||||||
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -13,6 +13,8 @@ export default class IconButton extends React.PureComponent {
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
icon: PropTypes.string.isRequired,
|
icon: PropTypes.string.isRequired,
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
|
onKeyUp: PropTypes.func,
|
||||||
|
onKeyDown: PropTypes.func,
|
||||||
onMouseEnter: PropTypes.func,
|
onMouseEnter: PropTypes.func,
|
||||||
onMouseLeave: PropTypes.func,
|
onMouseLeave: PropTypes.func,
|
||||||
size: PropTypes.number,
|
size: PropTypes.number,
|
||||||
|
@ -37,6 +39,8 @@ export default class IconButton extends React.PureComponent {
|
||||||
animate: false,
|
animate: false,
|
||||||
overlay: false,
|
overlay: false,
|
||||||
tabIndex: '0',
|
tabIndex: '0',
|
||||||
|
onKeyUp: () => {},
|
||||||
|
onKeyDown: () => {},
|
||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
onMouseEnter: () => {},
|
onMouseEnter: () => {},
|
||||||
onMouseLeave: () => {},
|
onMouseLeave: () => {},
|
||||||
|
@ -94,6 +98,8 @@ export default class IconButton extends React.PureComponent {
|
||||||
title={title}
|
title={title}
|
||||||
className={classes}
|
className={classes}
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
|
onKeyUp={this.props.onKeyUp}
|
||||||
|
onKeyDown={this.props.onKeyDown}
|
||||||
onMouseEnter={this.props.onMouseEnter}
|
onMouseEnter={this.props.onMouseEnter}
|
||||||
onMouseLeave={this.props.onMouseLeave}
|
onMouseLeave={this.props.onMouseLeave}
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
|
@ -119,6 +125,8 @@ export default class IconButton extends React.PureComponent {
|
||||||
title={title}
|
title={title}
|
||||||
className={classes}
|
className={classes}
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
|
onKeyUp={this.props.onKeyUp}
|
||||||
|
onKeyDown={this.props.onKeyDown}
|
||||||
onMouseEnter={this.props.onMouseEnter}
|
onMouseEnter={this.props.onMouseEnter}
|
||||||
onMouseLeave={this.props.onMouseLeave}
|
onMouseLeave={this.props.onMouseLeave}
|
||||||
tabIndex={tabIndex}
|
tabIndex={tabIndex}
|
||||||
|
|
|
@ -217,7 +217,8 @@
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
color: var(--primary-text-color--faint);
|
color: var(--primary-text-color--faint);
|
||||||
|
|
||||||
span {
|
span {
|
||||||
|
|
|
@ -36,7 +36,9 @@
|
||||||
transition: background-color 0.2s ease;
|
transition: background-color 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track {
|
.react-toggle:hover:not(.react-toggle--disabled) .react-toggle-track,
|
||||||
|
.react-toggle.react-toggle--focus:not(.react-toggle--disabled) .react-toggle-track,
|
||||||
|
.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {
|
||||||
background-color: var(--brand-color--hicontrast);
|
background-color: var(--brand-color--hicontrast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,10 +46,6 @@
|
||||||
background-color: var(--brand-color);
|
background-color: var(--brand-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track {
|
|
||||||
background-color: var(--brand-color--hicontrast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.react-toggle-track-check {
|
.react-toggle-track-check {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
|
|
|
@ -434,7 +434,8 @@
|
||||||
background: var(--brand-color--med);
|
background: var(--brand-color--med);
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&:focus {
|
||||||
background: hsla(var(--brand-color_hsl), 0.5);
|
background: hsla(var(--brand-color_hsl), 0.5);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,8 @@
|
||||||
background-color: var(--accent-color);
|
background-color: var(--accent-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover:not(.react-toggle--disabled) .react-toggle-track {
|
&:hover:not(.react-toggle--disabled) .react-toggle-track,
|
||||||
|
&.react-toggle--focus .react-toggle-track {
|
||||||
background-color: var(--accent-color--bright);
|
background-color: var(--accent-color--bright);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,7 +251,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active::before,
|
&.active::before,
|
||||||
&:hover::before {
|
&:hover::before,
|
||||||
|
&:focus::before {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
|
|
|
@ -479,6 +479,10 @@ code {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
background: var(--accent-color--faint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-wrapper {
|
.select-wrapper {
|
||||||
|
|
Loading…
Reference in a new issue