-
Notifications
You must be signed in to change notification settings - Fork 877
[WIP] docs(a11y-cookbook) add accessibility (a11y) cookbook #1049
Conversation
(April 5) Great start! I like the pace and the unfolding of concepts. I am unclear on when the techniques you show are wise and when the alternative isn't. For example, the labeling section begins with a large group of implicit label components. These lock the control inside beyond the reach of developer control (binding and styling). Are you recommending that we create these a11y components for ourselves? Why do I need these components? Once you tell me about wrapping a control in a label, do I really need them? Why and when is ...
... better than ...
Even more important: how do I use I have the same questions about your explicit label controls. But before that, I'd like to when to choose implicit over explicit label controls. You have two sentences on the subject but they don't help me decide if I chose to do the layout myself rather than use your a11y wrapper components. I'm so glad to learn about hidden labels. But do I need an entire suite of controls that duplicates your earlier ones just to restyle the label? Couldn't I just write
And why bother with it at all when I could omit the label and use the cool
To sum it up:
I don't mean to rain on the parade. You've have really good points in here and have taught me stuff that I didn't know and want to know! Keep it going! |
Thanks! As for parade-raining, not at all. Please don't pull punches, this doc has to be as good as possible and that is the only way. And this is exactly the info I was looking for at this stage of the doc. Hmm, the I took the `<a11y..' component line after looking at the examples in the doc Marcy shared with us. Got the message to focus more on Angular than just the HTML structure. Probably totally misunderstood. This was also where all my But after reading your comments I am convinced. For the vanilla examples I will be going back to just the HTML versions for basic constructs. For these no one should be creating a separate components, I think. Also actually falls in the first rule of Once this is clear I will provide some info on what to do IF you want to enrich your controls, like in my blogpost above, and how to tie it to And maybe looking at what if the input is indeed inside the control. But the sheer amount of extra code you need with the As for the other comments. Pure gold. Will be looking at those as well during the restructure. |
I love they way you sell the product. The problem is that the people is not aware of the problems of not having a11y and they just say "hey, it looks good, why do extra work?". I think that your cookbook covers that pretty well. I agree with all that Ward said here so I won't be repetitive. About the custom for control, I think that you could focus in something that is not, well, a control. I agree that having a component to wrap a label + input for a11y purposes is not appealing because it has no advantage over doing it directly. What I would do personally is having a different example that is not related to a form control. For example, if you build a custom dropdown menu, you want to add a11y to say: "Hey, this has a popup and it is actually closed / open". For example, I have a dropdown toggle like: @Directive({
selector: '[myDropdownToggle]',
host: {'class': 'dropdown-toggle', 'aria-haspopup': 'true', '[attr.aria-expanded]': '_dropdown.open'}
}) In this case, you don't expect people to write a custom dropdown directly but instead having a custom control for it, so teaching this good practices is something that works very well. Leaving this aside, one of the features I like from the "hidden element" is to mirror a feature that is not available for everyone. If you have a rating component for example, something like (simplified): <i class="glyphicon glyphicon-star"></i> as a star, ok, visually you see the star, but it is a good idea of having something like: <span class="visually-hidden">(*)</span> So having both you have the visual clue (star icon) and the non visual representation. I love a11y so please, keep your good work of making people aware that this is a necessity. |
Thanks for the comments Jesús! Brilliant examples that we need to show indeed. For now we are focussing ons some basic big wins but it will be expanded in future releases. Still trying to see exactly what will be in the first but your first example is a great idea for the section on Second is just as great! Here we'd need to link up the description to the field with Keep the good ideas coming! |
Lets put down the current planned sections for the cookbook for release 1 and also the backlog of items. Then we can track them, add/remove items and get them in the right order. A lot of these are from Marcy's starter document. I have added a few to the list Release 1:
Current backlog with possible items for inclusion
Points to consider in multiple sections:
|
Sounds exciting friend. I thought I knew some a11y but there are some stuff I never heard about, so I am expecting to see it :) |
<nav role="navigation"> | ||
<ol> | ||
<li> | ||
<a href="" [routerLink]="['FormControls']"><h2>Accessible form control labels</h2></a> |
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.
Why the href=""
? Doesn't routerLink
add it dynamically? I want to make sure there isn't a fix we need to do to routerLink
itself since most people would leave that off.
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 was purely my own OCD. Works 100% fine without adding it. Started doing this expecially for code metrics on the code base with checkers that do not understand Angular.
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
CLAs look good, thanks! |
CLAs look good, thanks! |
While creating content for the Keyboard Shortcuts section it became clear that valid examples, like menus and data tables, will make for pretty complex code. However we could make the barrier smaller to start with I have discussed this with Marcy and we are changing the scope for Release 1: Release 1:
Keyboard shortcuts have been touched on in the Managing Focus section as this is part of managing the keyboard focus. We will relook at this later to see if more complex examples are required. |
See #1181 with some extensive copyedits |
This PR is outdated and should be closed for preference of #1625 |
** DO NOT MERGE **
CLA Bot Note
Bot note on "CLA: No" - I created the PR, Almero is doing the work and is covered under the IdeaBlade CLA. The bot will never stop complaining but actually CLA compliance requirements have been met.