General

What is Accessibility and Why It Matters

Jessica Wilkins
3 min read
What is Accessibility and Why It Matters
This article was written over 18 months ago and may contain information that is out of date. Some content may still be relevant, but please refer to official documentation for the latest information.

Billions of people around the world use various web applications in their everyday lives. As web developers, we strive to build strong websites that can be used and enjoyed by everyone. But what is accessibility and why should we care about it?

Web accessibility is the practice of building websites that can be used by everyone. This includes those with disabilities, those with slow network connections or users on mobile phones. Everyone should have the ability to easily navigate and interact with all of the web content on the site.

Why is it Important to Design for Accessibility?

A large portion of websites online are not accessible for all users, and it creates a barrier to access information for some groups of individuals. The goal of accessibility is to not exclude anyone from information, products or services online.

A focus on accessibility promotes inclusion of all groups including the following:

  • Individuals with visual disabilities
  • Individuals with auditory disabilities
  • Individuals with motor disabilities
  • elderly individuals
  • those in developing countries affected by varying connection speeds
  • those in rural areas affected by varying connection speeds

A focus on accessibility is also really important for businesses. When a business creates strong accessible designs and web products, the user experience is much stronger and customers are left more satisfied with the end product.

What are the four principles of accessibility?

The Web Content Accessibility Guidelines(WCAG) are a set of guidelines and standards for accessibility. The WCAG has come up with the acronym POUR which stands for Perceivable, Operable, Understandable, and Robust.

Perceivable - Users should be able to perceive content through one of their senses (visual, sound or touch).

Operable - Users should be able to use all interactive elements on the page, and it should work with assistive technologies like screen readers.

Understandable - Users should be able to clearly understand the content on the website.

Robust - Users should be able to choose the technology they want to help them interact with on the website.

To learn more about these principles, please visit the W3C documentation.

What are examples of web accessibility?

There are many things you can do to ensure that your website is accessible to all. I will show you a few examples of what you can implement in your sites.

Semantic HTML

Semantic HTML describes the meaning of the content to the browser and developer. Examples of semantic HTML elements include main, article, and nav elements. When creating your markup, you should always strive to use semantic HTML when possible. Other elements like div and span tags hold no special meaning and act as generic containers.

Semantic HTML helps users relying on assistive technologies understand the meaning behind the content. Avoid using markups like this:

<div>
  <div>
    This is not semantic at all. I should probably use a semantic markup.
  </div>
</div>

Instead, you should write markup like this:

<main>
  <p>This is an example of semantic HTML. Semantic markup is the way to go.</p>
</main>

Alt text

Alt text is short descriptive text associated with an image or media element. It is used to help assistive technologies like screen readers understand the content. Inside your code, you would add an alt attribute inside the img element like this:

<img
  src="src-link-for-image-goes-here"
  alt="man sitting at desk writing code on their desktop"
/>

That short descriptive text will help those with visual disabilities understand what the image is supposed to be about.

When you are adding links on your website, it is really important that your link text is descriptive. You want to avoid creating link text like this:

<p>
  <a href="link-goes-here">Click here</a> to learn more about This Dot Labs.
</p>

"Click here" is not that descriptive, and doesn't tell you anything about where the link is going.

This would be an example of using descriptive anchor text.

<p>
  To learn more about our services, please visit the
  <a href="https://www.thisdot.co/">This Dot Labs website</a>.
</p>

Where can I learn more about web accessibility?

There are many great resources where you can learn more about accessibility. Here are a few options to choose from.

Conclusion

When you are building out your websites, please make sure that your content is accessible to everyone. A large portion of websites online are not accessible for all users and it creates a barrier to access information for some groups of individuals.

Remember that accessibility is not a feature, but a requirement when building strong web applications.

About the author

Jessica Wilkins

Jessica Wilkins

Software Engineer

Jessica Wilkins is a classical musician turned Software Engineer. Prior to joining the tech industry, she spent her time running her own sheet music company (JDW Sheet Music) as well as performing and teaching in Los Angeles, CA. She enjoys working with React and TypeScript. She is also a prolific technical writer for freeCodeCamp.

Keep reading

View all posts →

I Broke My Hand So You Don't Have To (First-Hand Accessibility Insights)

A perspective of a temporarily impaired developer on accessibility both from the perspective of a user and of a software engineer. Using the web disabled “surprisingly” makes you think about people’s experience on the web. Let us take you on that journey!...

Jan Kaiser5 mins
AccessibilityA11yWeb DevelopmentHTML

Understanding Vue's Reactive Data

A blog post that unravel how Reactivity works in Vue 3...

Jesús Padrón7 mins
VueJavaScriptTypeScriptWeb Development

Performance Analysis with Chrome DevTools

When it comes to performance, developers often use Lighthouse or similar performance analysis tools. But when the target site has protection against bots, getting information is not that simple. Chrome Devtools can help you with your performance analysis....

Balázs Tápai6 mins
DevToolsSEOWeb PerformanceWeb Development

How to Style Using SCSS in Nuxt

Introduction SASS makes working on large projects more organized. It allows you to use variables, nested rules, mixins, and functions. The preferred styling method in Nuxt is component file styling, and integrating SASS into your project can make your component file styling appear more understandable. How to Import SASS in Nuxt To add SASS after setting up your Nuxt application, we will first install SASS and sass loader. Let's run either of these commands depending on our package manager. Component File Styling With SASS and sass loader installed in our project, we can now write SCSS in our component file. Lets see an example: In the example above, all we need to specify is lang="scss" on the style tag, and we can now write scss in that component. Global File Import and Variables To import SCSS files that are global, like variables and mixins files, we need to install style resources: Next, we can update our nuxt.config.js file by adding the module we just installed to the buildModules. Next, let's create a global variables.scss file in our assets/style folder. Add a single variable inside: Next, we need to import this file inside the nuxt.config file: Now we have the variables in our variables.scss available in all our components for use. Next, let's test it out by updating our button component. We have updated our button variant color to be our global SCSS variable ($primary and $white). Mixins Mixins in SASS are used to write styles that can be reused in other parts of the code. Let's create a sample mixin to center an item. Next, we need to import our mixin in Nuxt config: Now, let's update our button component with our mixin: Functions Functions in SASS are used to write complex operations or behaviours that can be reused in other parts of the code. Let's create a function to handle a media query for our application. This is a basic example of what a function can be used for. More complex cases, like calculating percentage, can also be done. Let's import our mixin in Nuxt config: Let's update our button component with our function: We have been able to add SASS to our Nuxt project, and also looked at some ways in which SASS can make our codebase look cleaner. I hope this article has been helpful to you. If you encounter any issues, you can reach out to me on Twitter or Github....

Adesoji Temitope2 mins
Web DevelopmentNuxtJS