Categories
Online Marketing

DrupalCon Amsterdam 2019: Quick wins for an accessible website

I don’t need one. I don’t target blind users. Does it sound familiar to you? Yes, yes, what about a responsive website? Now I don’t need one. I don’t target mobile users. Does that sound familiar now somehow building responsive websites became an integral part of our workflow. However, accessibility is seen as something extra that we built upon it.

My hope, my dream is that we’ll be totally different in the next couple of years and I hope that’s the reason you’re all here as well. So what we’re going to do is we’re going to talk about some quick means how we can accelerate this. So we’re going to talk about what accessibility is to make sure we’re all on the same level about the definition, but also why it’s important and the most exciting part of part is of course, how are we going to do it? But the first question I want to answer is: Who am I I’m more dos? I am a front-end developer at new home, I’m also co-organized organizer of content, United and before I became a developer.

I worked in healthcare for like ten years and in health care. I noticed a lot of elderly people struggling with inaccessible websites and that’s the part where I came and testicle out it, but I didn’t know that accessibility was a thing in tech. I had no idea. So what is accessibility so when I started as a developer, I thought well yeah. Well, accessibility means that people with disabilities can use the web, but is that really the case now it not only helps disabled people, for example, subtitles.

It helps deaf people to understand. What’s being said in a article, but if we and if I’m not mistaken his face, almost 80 % of the articles on Facebook are being readed with some of, and I think that not everybody of the 80 % is actually deaf and contrast. If you have high contrast on your website, it helps usually disable people to read the text better, but also when you’re sitting in a very bright Sun.

It makes it much easier to read and semantic HTML. It helps screen readers to navigate through your pages, but Google does the same thing to rank your site and keyboard navigation helps physically disabled people who cannot use the mouse to navigate through your website, but also, if I fit in a very big form, I always use My keyboard I’ll never touch my mouse, so we have to have another definition, for what accessibility is, what accessibility means that websites tools technologies are designed and developed to work for all people, no matter their hardware, their software language, location or ability.

So this definition also gives a small answer to our next question. Why is it important and for many reasons, because all people benefit from it, but not only that a lot of products are being offered online. If I buy new socks, I buy it online. If I need a new book about online, but even worse, we also dependent on those digital services filling in my taxes. I have to do it online, so more companies need it need accessible website because they forget a larger audience, which is good for the profits.

The government needed because it’s legally required since last year – actually this year, it’s official now in Europe, but it has been required legally required in America for much longer time. Now. Look at the dominoes case, for example, and the problem is not the technology web sites are at least the web is accessible by itself, but because of us developers how we implement it, which makes it very inaccessible.

So how are we going to build an accessible website? We don’t have to invent it, because we have content, accessibility, guidelines for it and since there’s no last year we have a new version, which is the 2.1 version, and those guidelines consists of four principles which, in the receivable, operable unsellable and reboost, and those principles are Consists of guidelines and those guidelines are part of the success criteria and every success criteria has a level of conformance and legally required at least the Double A.

But if you AskMe English, as you all can hear, is not my native language. So, for me, those guidelines are pretty hard to read and quite hard to understand, sometimes, especially when I want to look something very quick, very quick and I have to read all those text and I’m not sure if I understand it correctly. So what I want to do here is to show you some practical examples in a live demonstration and we all know what happens in a live demonstration.

So bear with me – and I want to show you some tips and tricks about semantic structure, about links and buttons and about focus management. So for this case, I created a website for you a very basic, triple website and since there’s a lot of hate in this world, I want to distribute a lot of love. So all meat grinder, which is that they think that form for front-end developers, which is absolutely fake, of course, but just say, Utah, so basic dipper website.

This is the front page, which is a node, and I know it’s not correct to use a node as a front page, but hey it doesn’t matter. So if we analyze this first front page, you can see that the page is divided in multiple sections and those multiple sections are guided by headings. So, for example, we have, then you also see my mouse. So we have a friend which is the page site, or in this case we have some profiles and in these profiles we have some other headings that introduce the front-end developers.

We have some nice events and some news and so on, which are all confirm that these are headings yes. However, if we disable the styles with a web developer tool, it’s it’s it’s just a extension for chrome and it’s a Firefox as well, and we should disable the styles. We cannot see those headings anymore, as you can see here. This is me, navigation in search. The browser has some styling for headings by default, but the problem here is that we didn’t actually use heading tags to create our settings.

They only look like headings so to make sure you structure your content perfectly to help screen readers and, of course, removal to navigate through your pages. We have to convert them to actual heading tags, those heading tags, since it’s a triple side, came out different templates. So we’re going to find those templates so first so here we have the the page title and instead of using India, we just use a first heading tag and then we have the and for the section titles like the news and the profiles and and events we Enable the second heading, because that’s the way we have a structure, our page based on levels and the third are cards.

So this is for the profiles, which contains the names of the the front-end developers, and I have a different view modes for the other cards. For the news and for the for the events, so we changed all the headings for now and if you refresh the page, nothing changed and that’s exactly what we wanted, because it looks exactly the same. However, if we just say well the Styles again, we now can see all those headings back and that’s what we want.

So it looks the same, but it’s different on the body, and you want to disable yourselves from now and then to make sure how it really looks like just forget about the makeup, with just the real body, which is where that sells. So back to the front page, yes, so what we did here is created the structure based on the levels and based on the information we have on this page. So if we check the heading structure with a headings map extension also available for Firefox, is it matter? Okay good, so we had the first hanging tag.

We have a second heading tag. We have that hadn’t set, but what we do as developer as developers when we’re lazy, we reuse the View mode, for example, this view mode of of a front-end developer. So if we go to the landing page of the profiles in this case, we go to show more and we are back on the page. We have the first heading tag again, but we just concluded that this is a third heading tag. So if we check the headings map again we’re missing an heading level and there are multiple solutions for this.

We can write P process to saying that the name of the fungal developer should be a third having take on the front page or a second hand, tag on this page, but in this case I’m just a very lazy developer and I’m putting a second heading tag. Right here, just like that, so unable secondhand attack on this page specifically, and if you refresh it now we fixed it and if, if the design said designer said, oh, I don’t want a secondhand attack right there.

You can also visually hide it, for example, but more on that soon, all right does it make sense to check every page. Okay, if it makes sense to us. We also have to make sure that this makes sense for the content editors. So we want to provide the content at the freedom to structured account just the way we read it, so we enable this or is it this style thingy right here to add multiple headings based on the content, however, in daily life, most of them say yeah yeah.

I don’t like this: it’s very big blue heading. I just want to use the third heading just like that, and then it all goes wrong, so make make sure you instruct them how to use those heading structures and the most painful thing is if they very copy and paste it from word. For example, Google Drive and they just make it bold and beautiful. Also then, the heading tag isn’t actually, there only looks like a heading and that’s not what we want alright.

So back to the front page again – and last thing I want to talk about regarding headings – is the way we build and the function of the headings. So headings are a great way to bundle your information. So I have this very beautiful book over here and if I open it make it sound important because it is, for example, in the South States chapter title and I will deceptor text and it doesn’t really make sense if this steps is a couple of pages earlier Right, it makes sense to read it after the hell.

So when I started as a as a developer, I thought I built my HTML based on what I see an individual design so, for example, easy fancier. I see a visual, I see your date, then I see the heading and then I see the text and I normally used to create a HTML structure very based on what I just said. First, the visual down the date down the heading down the text. So if you take a look at this, this pizza party, I really love pizza and I would join this pizza party.

Definitely so it’s on the 10th of November correct all right. So if we disable the Styles again to check the actual body, you say: oh the cell – and we look for the pizza party right here. Yes, we have the pizza party and we read it like a book. Then we have yes, we have the text, we have a wrong image and it’s on the 2nd of May something went wrong here because we concluded the device of the time of November.

So how are we going to do that without not being lazy again so fix this? We have to change our HTML structure, let’s go to so for here. If we take out the template the twigs and play, we have our image right here, so I’m going to disable that and we have the rotate right here and now we are hiding right here and place all the other contents under the heading, just like the book. So we enable our date again and enable our visual again and if we go back to our page refresh it it’s a little bit broken, but hey no worries and if we disable the styles again, at least for certain that the structure is correct right now.

So we have pizza party at the end of November and this lovely picture of a pizza which makes me very hungry. To be honest, so the thing about flexbox is: it helps us to visually change order and what I did here is edit a flexbox to restore the styling, and let me show you how I did it, so the parent div has a display flex and the part The the the child in the depth that I wanted to show first visually, not in the HTML, gave it an order minus one.

So all the children of the parent div always have order zero, and if I put a minus 1 it becomes the first child in the parent visually. So let me show you how it looks like right now we restore it the style up. Guy. Sorry we restore the styling again, so the visual now is the minus one in the parent div of the carp and the date is the the first child element now in the textual bar div. So we fix that as well.

The last thing I want to talk about regarding the semantic HTML, so children. Instead, if we look at all those carts together, they’re kind of a list grouped together. However, the problem now, I’m not sure if it’s a problem, but the thing with Drupal is, is if this is a field, it gets outputted with all the dips, and it looks like this. This is this is just a basic few template of classy if-if-if.

I don’t even know what it actually means with all those if statements, so I override it in my own custom theme: where is it right here and basically it just it’s? It’s a div get the items in another div. But if you want to structure our content in a list, we have to create an ordered list. In this case, it was ordered based on the date. Otherwise, you can use it an ordered list if it’s not really bored, so we disable the div and instead use an ordered list, and it actually looks the same.

However, there’s one thing about the list: is we get bullets for numbers just like that right here? The two and three and, of course we can disable that, so that’s what the phone it’s so we are the list-style-type none and that’s a small issue with that. There is a bug in voice over that. If you use a list-style-type none, it removes all the semantics from the lists. Don’t know why nobody knows why.

But if you add this potato element, we have the content 200v, which is like this nothing more than that it restores the semantics back again. I don’t know why, if you know the answer, please let me know and then, if you go back, it still looks the same and now it’s an ordered list with other numbers with the correct semantics and if we disable the styles again, we see a very nice Structured HTML right, okay, good, so a small recap about the semantic HTML use, actual HTML heading tags, to bundle your information and make sure they’re correct on every page, even if you reuse any few modes and also provide a meaningful, meaningful and semantic HTML structure.

So next, what I’m going to talk about is links and buttons. So let’s go to the karaoke nut and I have a very beautiful link right here and you can see it because it has a different color. But what if I’m visually impaired – and I see it just like this – where is my link yeah, it says link, so he can’t recognize it because I said it was a link, but we also have to add a small text decoration to make sure it’s also visible.

Not only a bad color so, of course, and instead of text-decoration none, we just enabled the text decoration and this text on the land position under and just puts the light a little bit further down the bird. Just like a border bottom kind of thing. It’s not really supported in every browser yet, but it has a nice effect for now in google chrome, which is the browser that I use. So, as you can see now, I can recognize the link because it not only indicated by color and also it looks so very nice if you disable.

Oh, I didn’t have to refresh that it still looks very nice. If you ask me, we also used a lot of icons as links and great example are those socials, but at the bottom. Yet you can see that so we have a LinkedIn, we have a Twitter and we have YouTube, but if we disable the Styles again, of course, we cannot see what our links are anymore, because we only saw the icons so a screen reader cannot see that which One is LinkedIn or Twitter, but we remember which one.

What was I can help don’t be don’t so. Links always need a text and we have those socials in in my page. Sam played just right here and we enable the link text with a small span and, as you all can see, it has the class visually hidden and you can use that class out-of-the-box and Drupal it’s already incorporated and what it does is. It makes the the text very, very smaller, like one by one pixel and therefore it’s not visible anymore, but it’s still there for the screen reader and for Google so back to the page, and we still have linked in the three there.

The icons are very nice and when, if we disable the styles again now at least we can see which link is which so links always need a link text. But if you use an image as a link, the alt text is actually the link text. So, for example, at this beautifully new home image right here and it’s a link to our corporate website and if we inspected, this is writable okay kit, so at this link to our corporate website.

But the effects in this case is minimum local. So if we say out loud our link, yes, I go to Limu home no home, but that’s not what we’re handing we’re going to the corporate website. So in this case, we want to alter the alt text to the destination of the link, and it has to be so yes, so instead of this alt text be provided, alt text really open corporate website refresh it, and now it should be ok.

So the link text in this case is now in corporate website. So not only do links need a link text, we want them to be descriptive and unique, and I see a lot of designs which has this show more show more show more buttons. So let’s say I know, your name is dear Queen, just one of my nicest colleagues and let’s say your name right and we have another dear and another day and another dear, and if I ask you Alex, did Dirk order pizza do you know which their comment Know exactly the case with show more show more show more show more.

What I don’t know so, instead of using only to show more, we want to provide some extra information for, in this case, show more profiles and show more events. So we’re going to added to the link as well. I think it’s yes and enable this alright. So at least we have more information now about what we’re going to read more about, but this is the part where the designer comes in and says: hey. That’s not what I design I want to show more all of those buttons, and things should be the same size with the same padding and not all those large text in it, and in that case we can use the same technique.

We used for the for the Twitter and and the LinkedIn icons so, instead of actually using the whole show more profiles news, we add an extra visually hidden spun as well with the title in it. So if we refresh, we are back to show more and show more and show more, but if we disabled the cells again, we can see that the actual link text is show more events and show more profiles all right, so links go somewhere and buttons do something.

That’s a very big difference and every website, because pay responsiveness, has a hamburger menu buttons nowadays. So of course, this one has a menu button as well, because it’s responsive and if you take a look at this menu button, an old click, click click, click click Alex. Can you tell me if the menu is open or closed? Yes, I mean, is a menu open or closed? Oh, yes, it’s open, okay, speaking yeah, so, okay, I disabled the styles again and Alex this one is for you as well.

Okay, I click on the menu button. Not a professional. Is the menu open or closed exactly my point we can tell so if the button does something we have to indicate the state of the button. So there are two solutions for this, and one is altering the button text so instead only apply new menu, we want to add open menu or closed menu, so we’re going to do that first, so open menu closed menu, yes, and if we disable this stuff, so It’s not very hard, yes and I’m clicking on the menu button multiple times now is the menu open or closed yeah? Exactly yes, so this is one way to indicate the button state, but it’s not always a good idea to provide this only by text.

So I’m not sure if everyone anyone noticed it, we can also add an area expanded, true or false, and in that case we can just provide a menu button text and the area expanded announces to the screen music reader. If it’s open or closed, don’t do both. Otherwise, it will get announced twice. So in this case, we just remove the open and close text again, and I prefer that I exponent attribute, because that’s the way a screen reader user can tell how it’s how it needs to be announced, for example, with a very lovely tone or just with spoken Words or sham, for example, this is back then and their feet.

So if y’all can see the re accidental Falls and open, and that also indicates the state of the button. Does that make sense? Okay, nice? So a small recap about that one. We want to make sure that a link and a button is recognizable and clickable and provide meaningful and unique text and also communicate the state of the button when toggling talents. So the last thing I want to cover is focus management.

So if you’re back on the front page – and I want to use my keyboard navigation to navigate the page, who has never used the keyboard navigation. So if it’s up through this page and you can see in the in the very left corner that we are really navigating through a page, but we cannot see the focus outline and that’s because we disabled it in our CSS Amy right here and instead and now The outline is back again, however.

This is also the part where the designer comes in and says yeah. Can you remove that ugly blue line? No, no, we can, but we can change the styling of course. So, instead of using this very ugly blue line, we create a very nice designed outline look at that, but there’s one small problem: we made it white and from the moment we adjust the starting from the focus outline. We have the ownership of it and with the new guidelines, we have to make sure that the contrast of those outline is at least three to one.

So when I tap further of the line right here and now my baya Buckley and Zig Sebring, I cannot see the outline anymore and it is my responsibility to make sure it’s visible at all costs. So double check your page. If you navigate through to the page with your keywords, to make sure that the outline is visible everywhere, so in this case we just change the outline color when we are on the white part, you know it’s what and it’s a little bit blackish.

I guess down the line, so it’s visible everywhere, alright, so the other thing about responsiveness and accessibility is that we want that hamburger menu on the right side, power of our screen right because it’s easy to tell. But if you look at the rhythm we have on our desktop, which is logo, menu, search, local menu, search, repeat after me, menu something really changed right here we changed the ribbon and that’s the part where we add the JavaScript to make sure that the hamburger bet Button is really on the right side.

Now it doesn’t have to be like that we can visually change the order once again, as we saw earlier so instead, we let me check the JavaScript or the jQuery in this case, if, instead of appending it to the header on the far right, we want to Make sure that it’s a pendent to the main navigation right here and now we have the same rhythm, again: logo menu search. Yes, that’s a new hit and in this case we’re not so not that the menu is the first child of the parent death.

In this case, we want to make sure it’s the last child, so we can give it in higher order than zero, and I gave it an order three, but can be two as well and now it’s back again and the HTML structure is very the same as The same rhythm on desktop and on mobile, alright there’s just one small thing I forgot to mention – and actually it’s not really a legal requirement for governments at the moment, because it’s a triple-a solution is the click ability of this button.

So, as you can see, if I add a very beautiful background, color to this button, for example, background color green, it’s very, very small, especially when I open it, meaning that the clickable area on the mobile phone is very, very small. It’s only this green part. So, as you can see, if I click here and click here and I’m definitely almost on the cross bitch, it closes the menu right. So instead we wanted to make it a little bit bigger and I added this clickable area variable which is 4.

8. I don’t know why, because the the kauffman guideline says it should be at least 4 by 4 or 44 pixels by 44 pixels. But I just like the 48 number and instead we adjust the margins a little bit to make sure that it still has the same alignment that we had before but make the clickable area better. As you can see, I didn’t have to refresh this one. So back again, so it looks the same, but it’s about a clique wall and that’s exactly what we won, especially for those sweaty fingers here, and I even can’t reach out a little bit more tool to this case and we cut this cover as well.

So another thing with hamburger menus is that it hides the main navigation. That’s exactly what we want, so we have more spare space, but it should also be hidden for three meters. So if we go back to the logo, we go back to the menu and then we go navigate further and where are we? We are inside the menu and it’s a small problem because it’s visually hidden, but it’s still there for screen readers.

So, in this case, it’s this perfect case to actually use display, none, so we’re going to enable this small part of the code. Saying yeah you shouldn’t be there display none. I don’t want you to be there, not visually, not really there for screen readers, but when your main menu is open, show it as a block and let’s make sure that the the fish, the invisible elements cannot receive focus. So if we go back and we are back on the the logo again the menu and then we that we can’t go to the children also important regarding the focus management is, if you open the menu in this case.

Instead of navigating further, you want to make sure that the menu items are actual the first child that received focus just like that, but we don’t want. Is this number? That’s not what we want. You cannot do a thing right now. I can click and click, and maybe, if I go to another link, yes I’m back again, that’s also not what we want in this case, it’s very appropriate to add the kind of focus truck.

So if we go right here in this stating that, if you’re on the last item of the menu and you go to shift which is thrown to the next item, please put the focus back to the menu button and we go to the menu News and we’re Going back to the bottom and this course is to use to actually close the menu instead of getting lost somewhere behind the main menu. All right. So that’s my recap. So focus styling should be visible at all costs and if you decide to change the focus outline make sure you have a high enough contrast at least three to one and create a logical focus or to make sure it’s.

It’s the same rhythm on desktop and same rhythm on mobile and tablet and so forth, and to do that just never forget to disable yourselves from now and then to make sure that you actually see the body of your website not only the makeup and also navigate Through your website, with your keyboard on multiple pages, to make sure it’s really correct, and then I have a less sponsored content like I said, I’m a co-organizer front-engine I did – and this is an official announcement that we’re hosting fronted United means next year feel free to Come no, no, no just be there and going to be awesome and, of course, those very beautiful DrupalCon contribution.

I never contributed to Drupal because please help me it wants to be my first time and of course, what do you think and thank you all if there are any questions, I’m out no just kidding I haven’t bought, I can make one especially for your first now. I’d use in this case or just in general, because I use a lot of extensions to help me. Do automatic testing, specifically these ones, but all right. This one was the web developer tool and the headings map.

Yes, sir, a test suite that you can recommend that spiders a site and gives recommendations like I’ve heard of acts and there’s the microphone there. So, oh it’s over there! No! That’s! That’s a cleaver okay! Just wondering if there is a suite or speed of tools that you would recommend that, for instance, spider a site and give patterns of issues or specific issues and specific pages and your level of successes yeah.

Well, I use multiple tools because some cover some errors and other stones and even acts has different approaches because I used it in the browser acts core, but I also used it in my local environment and they both gave different errors, which was very strange. So I always used multiple automatic testing X is one of them that I use. I use wave toolbar and I use accessibility inside. If you ever heard of access with the inside that’s a great tool, I can show you do we have time five minutes now.

I can show you the tools that that I use mainly, for example, shirts. No, this is like ouch. I need the other one, this one. This is accessibility inside and it helps me to navigate through the pages that’s best and it helped me I’m not sure if it’s tap stops. This is a quick way to help me navigate from a page because of numbers. My links on the page there’s a buck in that in the JavaScript, so I have to disable this because I forgot to add resize it I’m sorry for that.

So so claps please. So it shows me exactly where I am on the page. That’s a quick way to test my keyboard navigation. If I lost it, for example, I use the wave to war that helps me define contrast where there’s a small error in this tool, because it also highlights the visually hidden text. For example, if I had a black background and black text, it fills, but I cannot see it so it doesn’t really is helpful in this case and acts mainly use axilla, but any other questions do you use also the screen readers for Mac OS windows.

I tried to use force over, but I’m not really an expert in it since I’m sorry, so I do if someone has a good idea about a course how to use a good screen reader or any tips to help me, please let me know I would like To know how to use it properly and eat other questions see yours truly on either


 

By Jimmy Dagger

Find out my interests on my awesome blog!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.