What is web accessibility adjustment and where to start? Start thinking about everybody. 
Published: 2020-10-30 11:57:51

I got an assignment to make accessibility adjustments to the existing project. My initial reaction was – oh, ok what exactly do I need to do? The response was vague. Well, you need to make a web page accessible for people with disabilities. Every kind of disability. Everybody needs an easy way to get to every information on the page. 

''Oh, ok but tell me what I need to do exactly?'' ''...well start with having a toggle button for bigger font size.''

So, I started with that ...


###__Dark mode__


Next step - the latest tech design trend - dark mode. After the initial implementation of the ability to change the font size on the web page, I implemented a dark mode option. My research leads to contrast levels. How readable are the color combinations on the web page and what is the best shade of black for the background?

And now we had this cool feature that is very trending, and more and more users choose to use the dark option in their apps. Of course, our main goal in this project was to help people with various vision and eye impairments.

Finally, after the initial review from the Association of Visually Impaired People, we received a proposal to make the following combinations: white on black, yellow on black, red on black, and green on black. So the final product in the widget has the following options:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vdfo0o2gah52mxnzxdnw.PNG)

The implementation was not very difficult. In [Lloyds design](https://lloyds-design.com/), we use Vue.js and Nuxt.js. Therefore, the @nuxtjs/color-mode is a great option.

Were these adjustments enough? Most of the sites have only these two options, but then I started to google more deeply. 


###__A11Y__


A11Y is something that is appearing when you start to research web accessibility. The A11Y Project is a community-driven effort to make digital accessibility easier. This is the right thing to google when starting to explore web accessibility. It refers to a global movement to make web content and computer systems more accessible.

In the beginning, it was hard finding the right resources. It was a lot of information and still, I couldn’t find the answer to what exactly I should implement into this project. 

I found out it is hard to please everybody's needs but you should at least try! The things that I learned and that I will implement (and fix) in the project are keyboard navigation adjustment, screen reader adjustment, letter-spacing change, font-size change, and of course, a readable font option. 


###__Why is this important – who are the users?__


“According to WHO, there are 285 million people worldwide who, due to some disability (i.e. they are suffering from low vision), cannot read all content on a website. 39 million of those people are blind and cannot access any of the content via sight.”  _https://www.sitepoint.com/how-many-users-need-accessible-websites/_

I found out a lot about how many users can't get to the information as easily as they should, considering we are in the 21st century. 


###__The adjustment you can make as a developer__


The first thing to do is to test your page navigation with the TAB key. When I started testing it, I found out I was making a big mistake in all of the projects I have ever made.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/s61q1ffw6sfsncsub2eh.PNG)

For keyboard navigation, users need to have a focus on the element they are on. This focus is, of course, not very pretty and it ruins the design concept of the page. The first thing that I did, I disabled focus on buttons. In fact, it was even disabled in my default CSS that I put in every project. 

This is nicely solved with a little script I found in a blog with the title that says it all [_“Removing that ugly: focus ring (and keeping it too)”_](https://medium.com/hackernoon/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2). This little script enables focus if the user is using TAB keys and disabling focus if the user is using the mouse.

Ok, this is solved. Let’s move on ...


####__<img> alt=""__


The image alt attribute provides alternative information for an image. Just please write that __alt__, it is not just for the errors in screening, it is for the users that are using screen readers. 

Also, a big mistake, if you think that an image is not important, then do not put just __alt__, you have to put __alt=""__. That is something I have seen a lot. __alt=""__ will tell the screen reader that it can skip that part.


####__Semantics, keyboard-enter__


Structural, semantic HTML is the key starting point toward good accessibility practices. Use HTML Elements the way they’re intended. The best way is to research how the screen-reader user and the only-keyboard user moves on the page. Then you will understand why is that so important. For example, never use a  __div__ or __span__ for a button when you could use a semantically meaningful __button__ element.

If you have an element like __SVG__ that is a call to action on your web page, then you have to give that element keyboard-enter function. In this way, a keyboard user can make that specific possible action. 


####__Tabindex=”0”__


When you already made some semantic mistakes or the design of the page makes it difficult to arrange everything in the right order, __tabindex__ can be very helpful. If you give an element __tabindex="0"__ it means that the element should be focusable in sequential keyboard navigation. If you don’t want to have a focus on the element, or you think for example the screen reader can skip this element because it will only confuse the flow of the page then use __tabindex="-1"__.


####__Don’t use carousels__


Good accessibility starts with the design. It is important to learn the fundamentals and principles behind accessible design. After your research, you will find that it is better not to use a carousel if you want to have the best accessible web page. But if I need to improve an existing project to be accessible you can put a carousel in the __tabindex="-1"__ and explain the content in some other way. 


####__aria-label__


The aria-label attribute is used to define a string that labels the current element. The best example is: 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yc1rdga1vn9kgsyl0uml.PNG)

When you have an element like this, a screen reader is not going to be able to read what exactly it represents, you give it an aria-label with an explanation. Without the aria-label in this example screen reader would read _“button x”_, on the other hand using it in this way would be read as _“button close”_. We can also use aria-roles to define the different roles of elements. 

####__Skip navigation links__

When users navigate through the page with a tab button it is good to help them with navigation. Skip links are very helpful, those are links that will be shown only to the keyboard users when they start going through the page. They will help in skipping all the links in the navigation and in going directly to the main part of that page. You can set navigation links for anything that you think will be useful for only-keyboard users. 

Imagine that you have to go through all 20 links in navigation every time you enter a new subpage. Help and make skip navigation links. In my project, I have made two. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7kee8fojnk704vgw2ae5.PNG)


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8jlhu0oc2uw976nqkulz.PNG)


####__OpenDyslexic__

Regarding readability, it is also important which fonts are being used. There are some widely used fonts that are more readable than others for people that have symptoms of dyslexia.  [OpenDyslexic](https://opendyslexic.org/) is an open-sourced font created to increase the readability for readers with dyslexia.
The great implementation of the project is to give users the possibilities to read content with different fonts. 


###__So what have I done and learned at the end?__


Here you can see a final widget for the project I have been working on [(Zadar Travel)](https://zadar.travel/)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/umqayf51owindh39gae6.PNG)

As you can see, I have implemented a toggle for changing the font to Open Dyslexic, 5 different color modes, two different font sizing, line height adjustment, letter-spacing adjustment, all preparation for screen readers users, and all adjustment for keyboard users. 

It is hard to make your project perfect and accessible in the best way for people with all kinds of disabilities. But we need to try to put our best effort. I have seen that a lot of projects that have implemented web accessibility have made very small adjustments. Although this is a very positive thing, it will be more helpful for many users that we step up and do more of these adjustments. 

The best way to see your project through different eyes is to test. Accessibility testing is best if you try to put yourself in somebody else's shoes. Turn on the screen reader and close your eyes, can you find all the information you need? Use only a keyboard and see if it is easy for you or you get frustrated.

So, this is my experience and first encounter with web accessibility implementation. It is definitely easier if you try to prepare everything at the design stage of the project but you can make changes and adjustments to every existing project.

The best thing I learned is that there are so many of us and why not make everything accessible for __EVERYBODY__. 

All comments, suggestions, questions, and critiques are more than welcome. Let’s try to build a better future and increase the standards together. 




Thank you for reading this! If you've found this interesting, consider leaving a :heart:, 🦄 , and of course, share and comment on your thoughts!

Lloyds is available for partnerships and open for new projects. If you want to know more about us, click [here](https://lloyds-design.com/).

Also, don’t forget to follow us on [Instagram](https://www.instagram.com/lloyds.design/) and [Facebook](https://www.facebook.com/lloydsgn)!