Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Start a free Basic trial
to watch this video
Design Like You Give a Damn: Creating Accessible Interfaces that Everyone Wants to Use
28:33 with Léonie WatsonRocket science is difficult, brain surgery is really difficult. To most people developing technology is insanely difficult, but you've already mastered the hard part. Creating interfaces that are usable by everyone is much easier than you think. In this talk Léonie Watson will look at the accessibility stack - the collection of technologies responsible for making interfaces accessible on different platforms. With help from a cast of screen readers, Léonie will use common design patterns to demonstrate why code is important to assistive technologies, and to explain why it's a good idea to think about code even at the UX/Design stage. When it comes to creating interfaces that can be used by everyone, there is no magic ingredient and no"magic sauce". The trick is just to let your imagination fly and design like you give a damn!
-
0:00
[MUSIC]
-
0:09
[APPLAUSE] >> Thank you very much and good morning.
-
0:15
And thank you everybody for coming to this talk.
-
0:18
I really don't need to introduce myself after
-
0:21
that comprehensive introduction from Ian.
-
0:24
One thing I will say though is that sometimes asking questions at conferences
-
0:27
like this can be a little bit scary, so my Twitter details are up on pretty
-
0:31
much every slide so if you don't feel like asking a question through the talk or
-
0:36
at the end, please come up and say hello afterwards or ping me a Tweet and
-
0:40
it'll be good to catch up and carry on the conversation.
-
0:43
So a conversation about what?
-
0:46
Well, making interfaces accessible so that people really want to use them.
-
0:52
Accessibility to my way of thinking has a bit of a brand problem.
-
0:57
It makes people think of legislation and conformance and guidelines and
-
1:02
being sued and all kinds of nasty bits and pieces.
-
1:05
But actually, for me, it's something much more fundamental than that.
-
1:08
It's just about designing like we give a damn.
-
1:11
Like we give a damn about the things we put our hearts and
-
1:13
souls into developing and creating, but
-
1:16
mostly like we give a damn about the people that are gonna be using them.
-
1:20
What I'd like to talk about today is my take on designing like we give a damn and
-
1:24
accessibility to offer some ideas about how we can make it happen in
-
1:29
a really practical sense and to look at the experiences of someone like me
-
1:34
who uses a screen reader to access computers and the Internet.
-
1:39
And to do that, I am gonna share four principals that I've used before that
-
1:44
explain my theory of designing like we give a damn.
-
1:49
>> Slide two: Design like Banksy [INAUDIBLE].
-
1:51
[INAUDIBLE] >> Oops.
-
1:53
What I should explain is that's my screen reader you're listening to there at about
-
1:56
the speed I tend to listen to it.
-
1:57
So don't try and follow along.
-
1:59
It'll probably drive you a bit nuts.
-
2:00
But trust me, it makes sense to me.
-
2:01
Or at least as much as anything ever does in this life.
-
2:04
So the first principle of designing like you give a damn is to design like Banksy,
-
2:10
which is to say read the rule book, understand it but don't ever be afraid
-
2:14
to challenge the accepted wisdom, rip it up and start again.
-
2:18
There's a lot of information out there about accessibility.
-
2:22
That maybe once was true, but certainly is no longer true, or is downright incorrect.
-
2:28
And I just wanna share some of those myths with you so
-
2:30
we can perhaps start to put them to rest for once and for all.
-
2:33
>> Slide three: Accessibility.
-
2:35
Accessibility.
-
2:35
>> Accessibility stifles innovation.
-
2:37
This is something I hear a lot, all of the time.
-
2:40
When you think about accessibility, people get a bit like, oh my goodness,
-
2:43
now we're going to have to put everything in black and white, and
-
2:45
it's all going to have to be just non-interactive and
-
2:47
there's going to be no shiny, that's really not what it's about at all.
-
2:50
If you get an idea for a product or a web application or
-
2:53
an app, whatever it is you want to build, don't let the thought of having to make it
-
2:57
accessible put you off innovating in the technology in itself.
-
3:01
All you need to do is just make accessibility one of the many
-
3:04
things that you think about when you're innovating.
-
3:06
You can innovate within accessibility as much as you can within any
-
3:09
other area of technology.
-
3:11
So don't let it stifle your imagination when it comes to building stuff.
-
3:15
Just think about the people that are gonna be using that product and
-
3:18
make the accessibility part of the innovation.
-
3:22
>> Accessibility kills creativity.
-
3:23
>> Accessibility kills creativity is something we hear quite often.
-
3:27
On screen, there's just a cast of my business card website.
-
3:31
You'll probably gather from the slides that I've got a bit of a thing for
-
3:34
the film noir kind of thing going on.
-
3:35
It's the same on my blog.
-
3:37
And a friend designed my business card website with a bit of CS animation just to
-
3:41
give it a bit of interest.
-
3:43
This is perfectly accessible.
-
3:44
It's all good semantic HTML.
-
3:46
You can turn off the animation if it's too distracting for you.
-
3:49
But, hopefully, it gives you an idea that accessibility can be something creative
-
3:54
and, like innovation, think about accessibility when you do the creation.
-
3:59
Don't let it slow you down.
-
4:01
>> Accessibility is difficult [INAUDIBLE].
-
4:03
>> This is something we hear a lot.
-
4:06
Accessibility isn't difficult.
-
4:07
What it is, actually, is unfamiliar for a lot of people.
-
4:11
What you guys do everyday is the difficult part.
-
4:14
You've learned JavaScript, HTML, CSS,
-
4:16
you've got those things most of the time to work in most browsers, and frankly,
-
4:20
if you can do that, everything else is pretty much a cinch.
-
4:24
The unfamiliarity is what slows people down with accessibility.
-
4:28
It's easy to know what it feels like when someone uses a tablet or
-
4:31
a desk top or a Netbook or a Macbook or whatever it may be.
-
4:35
But the chances are, you might not know what' it's like to use a screen reader.
-
4:39
That translates content into synthetic speech.
-
4:41
Or, to use speech recognition where you control your computer entirely
-
4:45
through voice commands.
-
4:46
But all of those things are pretty achievable.
-
4:48
We've got a MAC, hit command F5 and you'll get a screen reader.
-
4:53
Play around with it a little bit.
-
4:54
Know that it's command F5 will turn it off again so
-
4:56
otherwise you'll get stuck forever.
-
4:59
Most technologies on Windows you can download a free screen reader called NVDA.
-
5:04
From nvaccess.org.
-
5:06
Download it, grab it, play around with it.
-
5:08
You can get your hands on pretty much any kind of assistive technology, so
-
5:13
just take those first steps, and
-
5:14
experiment to remove that kind of level of unfamiliarity.
-
5:18
>> Slide six: Accessibility is irrelevant.
-
5:19
How families in an automated car driving along the highway next to a futuristic.
-
5:22
>> Accessibility is irrelevant.
-
5:23
A lot of people will say, well, you know, it's just for people with disabilities and
-
5:27
there's really not many of them out there in the world so, yeah, you know what.
-
5:31
The simple fact is that if you think about accessibility now you're gonna be making
-
5:34
things a hell of a lot better for yourself in 25 or 30 years time.
-
5:38
It's a sad but true fact is, as humans we tend to get a bit slower,
-
5:43
a bit less capable as we get older.
-
5:45
But the interesting thing about us now is that if you think about your older self,
-
5:49
your future self.
-
5:51
Are you really gonna have the patience and the tolerance to put up with a web
-
5:55
that won't let you go out and do the things that you do?
-
5:57
My hunch is, pretty much not.
-
5:59
If you've been used to using the internet to do whatever it is you want through your
-
6:02
younger life and then suddenly because your eyesight starts to deteriorate or
-
6:06
your hearing goes a little bit as you get older and
-
6:08
suddenly you discover you can't use something.
-
6:10
That's not gonna be an acceptable state of affairs for any of us.
-
6:13
So it's very much thinking about our future as
-
6:16
well as people in the current time when it comes to accessibility.
-
6:19
>> Slide seven: Design like Da Vinci.
-
6:24
>> So the next principle is to design like Da Vinci.
-
6:27
And never stop being curious about how we can make things better and
-
6:32
that's really important with all kinds of technology cuz very much that's
-
6:35
what we want to do with technology a lot of the time.
-
6:38
>> Slide eight: Perfect is the enemy of good.
-
6:40
Each carrot is a different shape, none of them conforming to the perfect shape.
-
6:43
Backslash. >> So enemy.
-
6:45
>> I'm having real trouble with this.
-
6:47
Perfection is the enemy of good.
-
6:49
You've got a bunch of lumpy carrots on the screen, I think.
-
6:51
It's dreadful trying to find a picture for this.
-
6:53
When you think about accessibility, there's a temptation to think that it's
-
6:56
gotta be perfect, and this comes back to this idea of complying with the law.
-
7:00
Needing to conform with some set of guidelines.
-
7:03
That's actually a really dangerous way to think about anything but
-
7:06
especially accessibility.
-
7:07
Because if you start to think about it having to be perfect,
-
7:10
you just quail at the whole idea.
-
7:12
It seems unachievable, insurmountable.
-
7:15
And then, quite often, you don't wanna take the first steps.
-
7:19
The truth is, is that with accessibility,
-
7:21
even if you do just a couple of little things,
-
7:23
you're going to be making a difference to somebody somewhere out there.
-
7:26
So don't worry about the big picture, just keep doing little things every day to
-
7:31
make a difference, and there's quite a few things we can do to make that difference.
-
7:35
>> Slide ten: Interaction.
-
7:38
>> Interaction.
-
7:39
If your an interaction designer think about talking to people.
-
7:43
And I think I just skipped a slide actually.
-
7:45
Which is to say we don't want to just keep throwing things over the wall.
-
7:49
Shout out if you've ever been working on a project where the interaction designers
-
7:53
and the prototypers have put together a fantastic set of interaction designs.
-
7:58
Handed it over to the design guys who've made it look beautiful and
-
8:00
absolutely fantastic.
-
8:02
Handed it over to the developers who've taken one look at it and
-
8:04
gone, we can't build that on the platform we're working on.
-
8:06
[INAUDIBLE] >> [LAUGH] Right?
-
8:08
We've all been there.
-
8:09
Trying to talk to each other all the way through this,
-
8:12
agile does help with this a lot, is a really kind of important thing.
-
8:15
And it's very much the same with accessibility.
-
8:18
So with interaction, when you're thinking about interaction,
-
8:21
think about the fact that people are using lots of different ways.
-
8:25
To consume the content.
-
8:27
>> Interaction.
-
8:28
>> So if we take something like a search.
-
8:30
It used to be back in the day that
-
8:33
most people used a mouse to interact with content.
-
8:36
Except for people with disabilities who, more or less, used a keyboard or
-
8:39
some device that mimicked the behavior of a keyboard.
-
8:42
That's really not the case anymore.
-
8:44
We all use touch, we use speech, we use mice,
-
8:47
we use keyboards to interact with content and you can't really now tell
-
8:52
which people using which of those things has a disability and which doesn't.
-
8:56
So when you're thinking about interaction, keep things really simple.
-
9:00
We've got a search field up on the screen now.
-
9:02
Is there an obvious way to execute that search?
-
9:05
Is there a button that says Search, or do something?
-
9:08
That's good usability for everybody, but if you're talking about somebody who's
-
9:11
perhaps on the autistic spectrum, where clear instructions are really,
-
9:14
really critical, having that button with the clear instruction to search or do or
-
9:19
whatever is very, very important.
-
9:22
If you're not sure that that's gonna be feasible,
-
9:24
talk to the designers to make sure it can be built in so it's obviously a button.
-
9:27
Talk to the developers to make sure the space and
-
9:30
capability to put that button there.
-
9:32
Similarly, make sure it's clear that this is a search.
-
9:35
There'll be visual labels but you need to make sure that there are labels for
-
9:40
screen reader users.
-
9:41
People like myself who can't see what's going on.
-
9:44
Something like a search.
-
9:44
There isn't always real estate to put that, kind of, search text label in.
-
9:47
But, again, go talk to the developers to find out if there's ways in the code to
-
9:52
make those labels available to screen reader users.
-
9:54
Trust me, there will be.
-
9:56
But, if you just make assumptions at this point, you could be building,
-
9:59
Corners that the developers and the designers really can't get out of.
-
10:03
>> Slide 11.
-
10:04
Design.
-
10:04
>> When it comes to design, and I'm gonna come back to buttons.
-
10:07
>> Design.
-
10:08
>> Buttons just always come in for grief in these talks.
-
10:12
Make sure that, when you've got an element or
-
10:14
a control, that the visual affordances are really, really obvious.
-
10:18
If it's gonna be a button, make sure it looks like a button.
-
10:20
Now the reason I'm picking up on this is because quite often, what we find
-
10:24
is that something that looks like a button under the hood when it comes to the code,
-
10:27
is in fact a link.
-
10:29
If you happen to use a screen reader or another assistive technology like
-
10:32
speech recognition, those two things are fundamentally different.
-
10:35
If you've got a speech recognition tool and you're looking
-
10:38
at something that appears to be a button, and you say click on that button, but it's
-
10:41
actually a link under the hood in the HTML code, those speech commands won't work.
-
10:45
It's the same with a screen reader.
-
10:46
If you click on a shortcut to move to the next button on the page, but the button
-
10:50
actually turns out to be a link, everything pretty much stops working.
-
10:53
So when you think about the design, not only is it really good to make sure that
-
10:57
something actually looks like what it is, but again, talk to the dev guys and
-
11:01
make sure that it's actually gonna be what it appears to be under the hood.
-
11:05
>> Slide 12. Choice.
-
11:06
>> Give people choices.
-
11:08
>> Choice.
-
11:09
>> This was all from my blog, and here I've just got a dark and
-
11:12
light color theme switcher.
-
11:14
That's just one example of how to give people choices when you're thinking
-
11:17
about a website.
-
11:18
It doesn't have to be color.
-
11:19
It could be some other form of personalization.
-
11:21
Could just be making sure that there's a capacity for the content to be zoomed
-
11:25
using the browser's function without kind of losing legibility or readability.
-
11:30
But these are all just kind of tiny little things that you can do.
-
11:32
None of them are really earth-shattering, but by talking and thinking about how
-
11:36
people interact with stuff, you can start to make a really big difference.
-
11:40
>> Slide 13.
-
11:40
Communicate.
-
11:41
>> And all through this is just the necessity to communicate.
-
11:45
Keep talking to each other.
-
11:46
That more than anything is the most vital thing because between you, you have all
-
11:50
the information that you kind of need, but if you keep working in isolation, well
-
11:53
we've all been there and done that, it's just gonna make life a lot more difficult.
-
11:57
>> [INAUDIBLE] >> So, design.
-
12:02
Design like Chanel and you might of heard of this if you keeping up with this,
-
12:06
strive for beauty and elegance in the things that you build, but
-
12:08
understand that those things are pretty much different for
-
12:11
everybody who's going to be using your content.
-
12:13
So what I'm going to do now,
-
12:15
is just going to give you some incites into what it's like using a screen reader.
-
12:20
>> Slide once more from the top.
-
12:22
>> So back in the day, what used to happen when you accessed a web page with a screen
-
12:26
reader is that it would be like reading a text document.
-
12:28
There was no semantic structure, no information at all.
-
12:31
You'd just start at the top of the page and
-
12:33
pretty much read your way down a bit like this.
-
12:35
>> [NOISE] Chapters and
-
12:39
those [INAUDIBLE] can be used
-
12:45
to insert content into page.
-
12:51
In some situations, this technique is a useful thing to do, but
-
12:54
how to browsers and screen readers handle the generated content?
-
12:57
Using Schema.org with Microdata posted and code things on February 25th,
-
13:02
2015 search engines have ways of extracting meaning from content.
-
13:05
But they are prone to error because information on the web can be presented in
-
13:09
so many different ways.
-
13:10
Marking up information so it's easier for
-
13:12
search engines to index is a good thing to do.
-
13:14
And thanks to the vocabularies available from Schema.org,
-
13:17
it's also very accessible.
-
13:18
Time out notifications
-
13:28
[INAUDIBLE].
-
13:33
>> You still with me out there?
-
13:34
>> [LAUGH] >> So this is kind of why it gave rise to
-
13:37
the idea that if you use an assistive technology like a screen-reader,
-
13:40
it took you a hell of a lot longer to do anything than your sighted counterparts.
-
13:43
It really isn't surprising because it really was that painful.
-
13:47
Things have kind of moved on in recent years, though.
-
13:49
>> Slide 16, [INAUDIBLE].
-
13:50
>> What we've got now is browsers that
-
13:54
make a lot more information available to assistive technologies.
-
13:57
This has led to the ability to navigate by different kinds of elements, like this.
-
14:02
>> [NOISE] Heading level one accessibility support for
-
14:05
CSS rated content heading level two length visited.
-
14:08
Using Schema.org with micro data adding level two length visited.
-
14:12
Accessible time out notifications adding level two length visited.
-
14:16
>> So that's just using a quick navigation short key.
-
14:18
In this case, the H key jumps you from one heading on the page to the next.
-
14:22
In most screen readers now, there are shortcut keys for jumping between tables,
-
14:26
images, links, headings, paragraphs, div's.
-
14:28
Pretty much any HTML element you can think of.
-
14:31
So it's no loner necessary to just start from the top and hope for the best.
-
14:35
You can actually move around within a page, but all this is very,
-
14:38
very dependent on the HTML being present and correct underneath, of course.
-
14:42
>> Slide 17, [INAUDIBLE].
-
14:44
>> With HTML5, something even more interesting happened, and
-
14:47
that was the introduction of the sectioning elements like Main, Article,
-
14:51
Header, Footer, Aside, and Nav.
-
14:54
They add even more semantic information to the page that screen readers can
-
14:57
make use of.
-
14:58
>> [SOUND] Main region.
-
15:01
Accessibility support for CSS generated content article.
-
15:05
Using Schema.org with Microdata article.
-
15:09
Accessible timeout notifications article.
-
15:11
Navigation region.
-
15:12
Complimentary information.
-
15:15
Search region.
-
15:16
Navigation region.
-
15:19
Contend information.
-
15:21
>> So with those just HTML five elements, just pure HTML,
-
15:24
there's nothing exciting under the hood there at all.
-
15:27
The screen reader is able to use another shortcut key
-
15:29
to make navigation between each of those elements possible.
-
15:32
But it could also tell you now which part of the page you're looking at.
-
15:35
Whether it's related to search or navigation, complementary,
-
15:39
which is what maps to the aside element, or other bits of page.
-
15:42
So suddenly, a screen reader user has gone from having to read from top to bottom,
-
15:46
to now actually being able to get a pretty good overview
-
15:49
of the page as a whole to kind of holistic idea of all the chunks on the page,
-
15:53
which until HTML 5 came along, was pretty much impossible.
-
15:57
So things are definitely kind of improving as technology moves on.
-
16:01
>> Slide 18, Modus Operandi.
-
16:03
>> One thing thing to be aware of is if you're using all these shortcut keys as
-
16:06
a screen reader, like H to move from heading, P to paragraph,
-
16:09
or whatever they might be in each screen reader, there are times when you're going
-
16:12
to actually need to use those letters for the things that they're intended to do.
-
16:16
>> Tab. Search edit.
-
16:18
S-O-M-E-T-H-I-N-G.
-
16:21
Tab. Search button.
-
16:22
>> So that popping noise just indicates that, in this case,
-
16:25
the screen reader, it's Jule if you're curious, has switch modes.
-
16:28
So instead of intercepting the keystrokes and using them for quick navigation around
-
16:32
the page, it's actually passing the keystroke back through to the browser so
-
16:36
they can just type into the form field,
-
16:38
as you'd pretty much expect them to under any normal circumstances.
-
16:42
>> Slide 19, accessibility mechanics.
-
16:44
>> So how does all of this work?
-
16:45
Well there's quite a lot of mechanics that goes on in the hood of the browser.
-
16:48
Something that you'll almost certainly know is that when you load content
-
16:52
into the browser, the browser will create a document object model.
-
16:55
Dom Tree, it's a hierarchical representation of the content that
-
16:59
contains a whole bunch of information that you can interact with,
-
17:02
manipulate, do all sorts of things to.
-
17:04
>> Slide 20.
-
17:05
>> What you might not know is that the browser also creates
-
17:08
an accessibility tree.
-
17:09
It takes a whole bunch of information from the DOM, and
-
17:12
creates an alternate hierarchical model.
-
17:14
And this model,
-
17:15
this tree contains information that's used specifically by assistive technologies.
-
17:20
And there's all kinds of information in there.
-
17:22
>> [INAUDIBLE] Role, role.
-
17:23
>> There's information about the role of each element on the page.
-
17:26
All HTML elements have implicit roles.
-
17:29
So onscreen, we've just got a check box, and input with a type="checkbox".
-
17:33
>> Bullet label equals.
-
17:35
>> And that type="checkbox" tells the browser that this is
-
17:39
an input with type checkbox.
-
17:40
That information is picked up in the accessibility tree and
-
17:44
used by assistive technologies, so
-
17:45
a screen reader encountering the control created with this code would tell the user
-
17:50
that this was a checkbox, and that's the role of it and its purpose if you like.
-
17:55
>> Slide 23, 23. >> You also get information about
-
17:57
the state, in this case we've got checked attribute on input.
-
18:02
And again, that state information is picked up by the accessibility tree, and
-
18:05
made available to assistive technologies.
-
18:07
So the screen reader would not only know that this was a check box, but
-
18:10
it would also know that it was in the checked state.
-
18:12
>> Slide 24 >> Lastly,
-
18:15
the information in the accessibility tree contains a whole bunch
-
18:17
of accessibility properties about an element.
-
18:19
The most common of them is the accessible name for an element.
-
18:23
Which is basically the way that you tell,
-
18:26
in this case one check box on the page from the next.
-
18:29
>> [INAUDIBLE].
-
18:30
>> [NOISE] We've done it in this case by just using the label element and
-
18:33
hooking it up to the input using the foreign ID attribute pairing.
-
18:36
Really, really basic 101 HTML.
-
18:39
But now, a screen reader coming to this page will know that the name of this check
-
18:43
box is Tequila, as opposed to any other that might be on the page.
-
18:47
Speech recognition user for now could say, uncheck the tequilla check box.
-
18:52
Just identifying it by name, in a way that you identify a person by a name.
-
18:56
>> Slide 25, Accessibility APIS.
-
18:58
>> So all these works thru Accessibility APIS.
-
19:01
Form has one.
-
19:02
Windows, Linux, OSX, IOS, Android.
-
19:06
They all work at the operating system level.
-
19:08
So the idea is that if an assisted technology wants to know
-
19:11
something about an interface, it gets the same information back whether it's asking
-
19:15
something at the operating system level, something within an application interface,
-
19:19
or something within the rendered content within a browser.
-
19:23
>> Slide 26, Design like Brunel.
-
19:25
>> So, how does all this work in practice?
-
19:27
We're going to take a bit of dive into some code now and pull some of this
-
19:30
together to give you a working example of how the accessibility API is,
-
19:34
the accessibility tree all come together to makes things more accessible for
-
19:38
screen readers, in this case.
-
19:39
>> Slide 27, Skeleton HTML.
-
19:40
HTML. >> So
-
19:41
we're gonna start by building a custom disclosure widget.
-
19:44
Yes, it's always better to use a native HTML element because you get a lot
-
19:48
of accessibility goodness built in, but, with the advent of JS frameworks,
-
19:52
where unfortunately the output code is not always created by people who understand
-
19:57
good quality semantic HTML, because we get stuck where we need to remediate legacy
-
20:01
code that was built in goodness knows when We're just gonna take a worst case
-
20:05
scenario, and that's starting with a span that we're gonna use as the control for
-
20:10
disclosure element or widget, and
-
20:12
a div that's gonna contain the content to be disclosed.
-
20:16
>> Slide 28.
-
20:16
Using a mouse. >> If we imagine we just throw a bit of
-
20:18
CSS and scripting at it, this is how it would pretty much work for a mouse user.
-
20:23
>> Using a mouse.
-
20:32
So, all well and good.
-
20:33
Things open, they shut.
-
20:34
Content appears.
-
20:35
It's all pretty good.
-
20:37
Slide 29.
-
20:37
Using a keyboard. >> If you looked at it on a keyboard,
-
20:39
this is what would happen.
-
20:43
That's it.
-
20:43
Nothing.
-
20:44
Absolutely nada.
-
20:45
A span is not an interactive element, so you can't focus on it with a keyboard.
-
20:49
You can't use the tab key to get to that control.
-
20:51
So, for a keyboard only user, that's it.
-
20:53
Game over.
-
20:54
Bother shouting.
-
20:55
If you throw a screen reader into the mix, it is actually possible to focus on
-
20:59
that control because there are ways to do that without using the tab key,
-
21:02
but this is the net effect.
-
21:04
>> That's it.
-
21:06
Just the one word.
-
21:07
There's no indication that this is actually a button, or
-
21:09
anything more exciting or interactive than a piece of text.
-
21:13
And that's because div and span, or
-
21:15
span specifically, isn't semantically neutral element.
-
21:18
So, in the accessibility tree, it's really just treated as a piece of plain text.
-
21:22
So, we need to start adding some more information into the browser's
-
21:25
accessibility tree to give screen readers something a bit more concrete
-
21:28
to deal with.
-
21:29
>> Slide 30.
-
21:30
Add role.
-
21:31
>> And we're going to do that using some Aria attributes.
-
21:34
Accessible rich internet applications.
-
21:36
Version one is the current version with respect from the W3C.
-
21:39
So sets of attributes that you can apply to HTML markup and, increasingly,
-
21:44
to SVG, as well, that lets you manipulate, or
-
21:47
change the information that's available in the browser's accessibility tree.
-
21:51
Aria doesn't change functionality,
-
21:53
doesn't add behavior, it just changes the semantics of what we're dealing with.
-
21:57
So, the first thing we're going to do is use the Aria role attribute
-
22:00
with a value of button.
-
22:02
And that gets applied to the spam and will basically, in the accessibility tree,
-
22:06
tell assisted technologies, quit treating this like a spam, treat it like a button.
-
22:10
It's really important to stress though, this doesn't change anything in the Dom.
-
22:13
It's only in the accessibility tree that stuff changes.
-
22:16
Slide 31, add to index, full printer.
-
22:18
>> We're gonna add tab index with a value of zero.
-
22:20
>> Bullets bullet.
-
22:20
>> And we're gonna do that on the span as well.
-
22:22
That's gonna make it keyboard focusable.
-
22:24
Tab index with a value of zero will place this into the tab order of the page
-
22:28
based on the elements location in the dom so it keeps it really natural.
-
22:32
It'll just slot it into the natural keyboard order of the page so
-
22:35
it's a good way to do it.
-
22:36
>> Slide 32, add focus impulse, play button.
-
22:38
>> We're then going to add some focus visuals.
-
22:40
So now you can focus on it with a keyboard.
-
22:41
It's really important to know that you focused on it with a keyboard.
-
22:44
So we're just gonna duplicate the hover styles that were in place already and
-
22:48
just make those work so that when you tab onto that control you get that same
-
22:52
visual change in appearance that lets you know exactly where your focus lies.
-
22:57
>> Slide 33. Add event listeners.
-
22:58
Listeners.
-
22:59
>> We're gonna add in some event listeners, so
-
23:00
there's a good chance already that the event listener for click is in place, but
-
23:05
we also need to listen out for keyboard events.
-
23:08
We're gonna listen for the key down event as opposed to key press or
-
23:11
any other because the expected interaction for a keyboard user and
-
23:15
a button is that you can use either the space key or the enter key to activate it.
-
23:19
If you're using the button element, the native button element,
-
23:22
that's what you get built-in by the browser automatically.
-
23:25
So we're gonna listen for the key down because we need to capture the key code,
-
23:28
so we can identify which key's been pressed and add in some functionality.
-
23:33
And all we're doing here is just listening out for those keys.
-
23:35
If any other key is pressed, we're just letting them get on to do their thing.
-
23:39
But if either of the key codes, 32 or 13,
-
23:42
are identified, then we're just gonna make sure that the rest of the function
-
23:46
that we need to execute is carried out based on those key commands.
-
23:50
Slide 35. Add Aria-Expanded Expanded.
-
23:52
>> We're gonna come back to some Aria now and add in the Aria-Expanded attribute.
-
23:57
Again, that goes on the span.
-
23:58
[SOUND] >> Bullets bullet.
-
24:00
>> And what this does is indicate the state of the disclosure widget.
-
24:03
So we'll set it to false initially on the assumption that the disclosure widget
-
24:07
is closed.
-
24:08
But as the widget is activated, the script will toggle it to be true and that'll just
-
24:13
inform the screen reader whether the thing is open or closed in its current state.
-
24:17
Slide 36. Add state visuals.
-
24:19
Visuals. >> Then we're going to map some visuals to
-
24:21
that as well because if we're going to make custom faces accessible to everybody.
-
24:25
It's not just about us screen reader users,
-
24:27
we need to think about you sighted guys too.
-
24:29
So, we're going to add in an icon that just flips over depending on the state and
-
24:33
we're gonna bind that to the current value of the area expanded attribute.
-
24:39
Using attribute select is a really neat way to keep things neat and tidy.
-
24:43
Stops you having to clutter up stuff with class names in your HTML.
-
24:47
Actually, I have to thank Hayden Pickering, one of the other speakers here
-
24:50
this week for that particular tip, which I've become extremely fond of.
-
24:54
>> Slide 37. Add Aria-Controls.
-
24:55
Bullets equals quotes.
-
24:55
>> We're gonna add in some more Aria, the Aria-Controls property, and we're gonna
-
24:59
use this to create a relationship between the control button and the content.
-
25:04
Bullet id Mismatch >> When you look at this and
-
25:07
you activate the widget, you're gonna know that something has appeared.
-
25:10
It's gonna be really obvious.
-
25:11
But if you're using a screen reader and
-
25:12
you hit the button, it's not gonna be obvious that some content has appeared.
-
25:16
What the Aria-Controls attribute does is create a relationship that will tell
-
25:20
the screen reader to inform the user that they can move, take a shortcut,
-
25:24
to the content that's being controlled by the button.
-
25:27
So, it just sets up that relationship and enables a navigation mechanism for
-
25:31
moving to it.
-
25:31
>> Slide thirty-eight.
-
25:32
Add Aria hidden. Bullets list.
-
25:34
>> We're going to add in Aria-hidden and
-
25:35
we're going to do that in a couple of places.
-
25:38
We're going to add into the span where the icon is shown and
-
25:41
also to the div where the content is.
-
25:44
[SOUND] >> Bullet divides bullet.
-
25:45
>> What Aria-Hidden does is remove content completely from the accessibility tree.
-
25:50
So as far as the browser's accessibility tree and
-
25:52
any assistive technology is concerned this content won't exist.
-
25:56
So we'll set hidden to true on the icon span because there's no real need for
-
26:00
a screen-reader user ever to need to know about that icon.
-
26:04
We'll also set it on the div.
-
26:05
We'll set it to true initially because the content will be hidden.
-
26:09
And then as the widget is activated, we'll toggle it backwards and
-
26:12
forwards between true and false.
-
26:14
Slide 39.
-
26:14
Add more state visuals.
-
26:15
Bulletin=quote.
-
26:16
>> We're then going to add some more visuals in there and
-
26:19
that's just making sure that the content is shown in high based on the CSS.
-
26:24
You might be asking why user are hidden and something like display none.
-
26:29
It's really belt and braces techniques.
-
26:31
If we don't need the content to be rendered in the accessibility tree.
-
26:34
There's really no point in making it be there.
-
26:36
So, Aria hidden just kind of takes that out of the equation.
-
26:39
There's also kind of an edge case where someone might not have CSS enabled.
-
26:43
It's fairly slim edge case these days, but
-
26:46
the RA hidden would still just make sure that the content was
-
26:49
tucked away from assistive technology users, even if that was the case.
-
26:52
Slide 40. Add functionality.
-
26:53
Function title disclosure.
-
26:54
>> Lastly, we're just going to add in some functionality, so
-
26:56
we're going to make sure that the whole thing works.
-
26:58
So if someone activates the button and the script is executed,
-
27:01
we're just going to toggle the states of all those Aria attributes,
-
27:04
the Aria hidden and the Aria expanded.
-
27:07
And in doing so kind of kick off the cascade that ties in the CSS to create
-
27:10
the the right visuals, and hopefully bring the whole thing together.
-
27:13
>> Slide 41. Using the screen reader.
-
27:14
>> So, [LAUGH] after all that little lot,
-
27:16
this is the difference that it makes to someone using a screen reader.
-
27:20
>> Using the screen.
-
27:21
To feel the button collapsed.
-
27:22
To feel the button expanded use Jaws
-
27:25
key/g+Alt+M to move the controlled element.
-
27:28
Move the controlled element.
-
27:29
Makes me happy...
-
27:30
[LAUGH] Trust me.
-
27:33
Tequila does make me happy.
-
27:34
But [LAUGH] what should hopefully make us even more happy
-
27:37
is that we've still got the disclosure widget that, on the face of it, looks and
-
27:41
behaves and appears exactly as we originally intended it to but
-
27:46
now has a whole bunch of accessibility built in under the hood
-
27:49
to make the experience more inclusive for many more different people.
-
27:53
And that sort of really comes back to this whole idea about designing
-
27:56
like we give a damn.
-
27:57
Go out there, build the thing you want to build, create the thing you want to
-
28:00
create, be as inavertative and outlandish and mad and crazy as you can possibly be.
-
28:06
But know that there are ways that you can make things accessible.
-
28:10
If you're not sure where to go from here, as they say, come and shout me afterwards.
-
28:13
Questions now, or ping me on Twitter, but myself and
-
28:15
plenty of other people out there in the accessibility world are really happy
-
28:18
to help answer you and point you in the right direction.
-
28:21
Slide 42. [INAUDIBLE]
-
28:22
>> Thank you.
-
28:27
>> [APPLAUSE] [MUSIC]
You need to sign up for Treehouse in order to download course files.
Sign up