-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Make toolbar accessible #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Now that the play/pause buttons are button elements, they have an outline when you click them which doesn't look great. Does adding Also, for the css, I prefer to use BEM, as in the class for the buttons should be |
I didn't entirely get the class naming, should |
Yes exactly! |
I added BEM style to the buttons, however both styles look similar now. |
The BEM philosophy is for each HTML element to have one class (though I find myself breaking this more than occasionally), because CSS specificity rules get annoying fast and are hard to debug. I recommend reading about BEM to understand why it's used. There are lots of other CSS philosophies, like OOCSS, but for me, I find using BEM the easiest. In the Toolbar component, the buttons should be either Then, to make all of this work with SCSS, what you can do is in the %toolbar-button placeholder in _placeholders.scss, change it to %toolbar-button {
//...existing styles...
&--selected {
background-color: $light-button-background-hover-color;
& g {
fill: $light-button-hover-color;
}
}
} Then, in _toolbar.scss, the stop button would look like .toolbar__stop-button {
@extend %toolbar-button;
&--selected {
@extend %toolbar-button;
@extend %toolbar-button--selected;
}
} |
Thanks for the above, I'll make the changes ! I stand corrected on what I said about
But I see how this throws off the aesthetics. As this works well with screen readers right now ( with Edit : All these articles seem pretty old - but this was one suggestion - paciellogroup |
I'm okay with figuring out the outline stuff later! For this project I know that there is some design budget so we can just save it for when we need a bunch of design input. |
Great, I've added a card to look at this - trello card |
@@ -10,23 +10,25 @@ class Toolbar extends React.Component { | |||
render() { | |||
let playButtonClass = classNames({ | |||
"toolbar__play-button": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line should be
"toolbar__play-button": !this.props.isPlaying
In the current code, the html works as follows.
when stop is selected
Based on my findings while reading up on BEM, the standard seems to be that the modifier class is added to the base class instead of replacing it.
Additionally, it seems like replacing it has a few drawbacks. That's why I have structured the code as is. Please let me know if I'm missing something and we should go for the single class approach. |
Cool, my bad, let's leave it that way then. 😄 |
* Change accessibility example links * added library to iframe * changed preview to add accessible elements to iframe * add library only when accesible output is seleceted * focus on iframe when plaing * css * deleted accessibleOutput.jsx and edited IDEView to integrate accessibility library * deleted comments * fix package * Moved CSS to library and removed section from file.js (#2) * Remove gitmodule (#509) * remove git modules * removed submodule and replaced interceptor for library * removed submodule and replaced interceptor for library (#510) * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * Fixes #508 (#539) * removed submodule and replaced interceptor for library * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * remove empty divs from files.js * fix merge error * remove empty divs from files.js * Fixes #508 (#545) * removed submodule and replaced interceptor for library * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * remove empty divs from files.js * fix merge error * remove empty divs from files.js * moved accessible output css * removed css, added aria-label, preliminary cdn update * removed section from iframe * updated cdn * add autofocus; remove CSS
Change language in one place
Trello card
This PR: