Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Post: Pitfalls of accessible components #1490

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/_data/authors.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
"photo": "https://avatars3.githubusercontent.com/u/634191?s=460&u=d63a740900d1af3ce4d52fdb69a8f8f265782d3c&v=4",
"biography": "I help create straightforward solutions that address a person’s practical, physical, cognitive, and emotional needs using accessible, performant, device-agnostic technology."
},
{
"name": "Erik Kroes",
"first": "Erik",
"website": "https://www.erikKroes.nl/",
"photo": "{{ '/img/authors/erik-kroes.jpg' | url }}",
"biography": "🎉 Art, Web Accessibility & Design Systems 🎉"
},
{
"name": "Erik Runyon",
"first": "Erik",
Expand Down
Binary file added src/img/authors/erik-kroes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 90 additions & 0 deletions src/posts/pitfalls-of-accessible-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: Pitfalls of accessible components
description:
category: Background
author: Erik Kroes
date: 2022-11-30
last_updated: 2022-11-30
tags:
- background
---

No matter how beautiful your building blocks (components) are, you can still build wrong with them!
More and more you see that components claim to be accessible. That sounds good: components that can be used by everyone, including people with disabilities! It is not always clear what exactly such a claim entails. In addition, it does not give you any guarantees as a builder. You can still make a mess!
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
No matter how beautiful your building blocks (components) are, you can still build wrong with them!
More and more you see that components claim to be accessible. That sounds good: components that can be used by everyone, including people with disabilities! It is not always clear what exactly such a claim entails. In addition, it does not give you any guarantees as a builder. You can still make a mess!
No matter how beautiful your components are, you can still build wrong with them.
More and more you see that components claiming to be accessible. That sounds good: components that can be used by everyone, including people with disabilities! It is not always clear what exactly such a claim entails. In addition, it does not give you any guarantees as a builder. You can still make a mess.
  1. The title uses "components" so I removed it from its parenthetical. We could define, or link to a definition of what a component is later, if needed.
  2. Added a newline so we get two separate paragraphs.
  3. Toned down the exclamation points, in keeping with our styleguide

What can go wrong? We look at some common pitfalls.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
What can go wrong? We look at some common pitfalls.
What can go wrong? Here are some common pitfalls:

Personal preference, but I try to avoid terms like "look", "see", etc. given the audience this site serves, unless it is directly referencing a specific behavior.


## What are components good for?

Components are great for anything you need to do more than once. You don't want to design and build your button or link every time. That's a waste of your time. You would rather build one version that is very good, and then you can reuse it. Why often build something halfway, if you can spend all that time in one very good version? You can then test that one version with different browsers, mobile, with screen readers and hopefully even with real users!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Components are great for anything you need to do more than once. You don't want to design and build your button or link every time. That's a waste of your time. You would rather build one version that is very good, and then you can reuse it. Why often build something halfway, if you can spend all that time in one very good version? You can then test that one version with different browsers, mobile, with screen readers and hopefully even with real users!
Why often build something halfway, if you can spend all that time in one very good version? You can then test that one version with different browsers, mobile, with screen readers and hopefully even with real users!
Components are great for anything you need to do more than once. You don't want to design and build your button or link every time. That's a waste of your time. You would rather build one version that is very good, and then you can reuse it.

Flipped this to plead to component's use case, then broke into two paragraphs as they are two separate thoughts. This will also help lower the overall reading level.

What you immediately get is consistency. You make everyone happy with that! For example, consider a focus state that is the same everywhere. That takes a lot of thinking.

<figure role="figure" aria-label="It's all in the application.">
<img alt="A plastic playset is placed on the roof edge of an appartment building." src="/img/posts/pitfalls-of-accessible-components/playset.png" />
<figcaption>It's all in the application.</figcaption>
</figure>
Comment on lines +21 to +24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣


## Page-specific: content
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Page-specific: content
## Component considerations: content

I was a little confused about this heading until I read further. What do you think about this phrasing?


One page is not the other. And it is precisely in the parts that vary that things can of course still go wrong.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little unclear what this means. Could we revise?


### Content

A bit of a tinkering perhaps, but good to be aware of. You write content for every page. It must be accessible. You can think of avoiding complex language, and avoiding descriptions based on specific senses (such as an "open the red link" or "the text to the right of this").
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A bit of a tinkering perhaps, but good to be aware of. You write content for every page. It must be accessible. You can think of avoiding complex language, and avoiding descriptions based on specific senses (such as an "open the red link" or "the text to the right of this").
You write content for every page. It must be accessible. You can think of avoiding complex language, and avoiding descriptions based on specific senses (such as an "open the red link" or "the text to the right of this").

I removed the first sentence as I was less confused reading through this section with its removal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A bit of a tinkering perhaps, but good to be aware of. You write content for every page. It must be accessible. You can think of avoiding complex language, and avoiding descriptions based on specific senses (such as an "open the red link" or "the text to the right of this").
A bit of a tinkering perhaps, but good to be aware of. You write content for every page. It must be accessible. You can think of avoiding complex language, and avoiding descriptions based on specific senses (such as an "open the red link" or "the text to the right of this").

Added a newline for the new paragraph.

Content also goes beyond paragraphs and text blocks. Don't forget your alternate texts for images, or captions and transcripts for other media files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Content also goes beyond paragraphs and text blocks. Don't forget your alternate texts for images, or captions and transcripts for other media files.
Content also goes beyond paragraphs and text blocks. Don't forget alternate texts for images, captions and transcripts for media files, etc..


### The page title

Match this as much as possible with the main heading on your page (the `<h1>`) and the names of the links pointing to the page. If there are repeating parts in the title (such as the name of the website), place them as far back in the title as possible. This makes scanning (also with screen readers) easier. The unique and distinctive part comes first.
In a webshop you get something like: “Product - category - webShopName.nl”
Comment on lines +35 to +38
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unclear how this relates to components.


## Page-specific: structure

Perhaps you have something reusable for this, such as templates. That's very nice. However, experience shows that these are not always available and do not have priority.
Comment on lines +40 to +42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also unclear how this relates to components. Are you suggesting that page layout is part of a component abstraction strategy?


### Landmarks

You want to have your landmarks in order for each page:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link to what landmarks are, for readers who may be unfamiliar? Maybe the MDN?

- Place your navigation in a `<nav>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rephrase this so it doesn't accidentally imply that all navigation goes into one single nav element?

- Place the most important content in a `<main>`
- Use a `<header>` at the beginning of your page and a `<footer>` at the end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all pages have headers and footers?

- Do you have information aside? Then use a `<aside>`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a synonym for the first use of "aside"?


### Heading structure

Your headings help people navigate through your page. Just like you can scan headlines in a newspaper, you want to do the same on a website.
The `<h1>` is for the main heading; for what your page is about. Below that you want to create a kind of tree structure of your headings. All content logically (both visually and in code) falls under one of your headings. You go from main topic (`<h1>`) to sub-topic (`<h2>`), to sub-sub-topic (`<h3>`), and so on. Never move forward more than one step at a time.
Comment on lines +54 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Your headings help people navigate through your page. Just like you can scan headlines in a newspaper, you want to do the same on a website.
The `<h1>` is for the main heading; for what your page is about. Below that you want to create a kind of tree structure of your headings. All content logically (both visually and in code) falls under one of your headings. You go from main topic (`<h1>`) to sub-topic (`<h2>`), to sub-sub-topic (`<h3>`), and so on. Never move forward more than one step at a time.
Your headings help people navigate through your page. Just like you can scan headlines in a newspaper, you want to do the same on a website.
The `<h1>` is for the main heading; for what your page is about. Below that you want to create a kind of tree structure of your headings. All content logically (both visually and in code) falls under one of your headings. You go from main topic (`<h1>`) to sub-topic (`<h2>`), to sub-sub-topic (`<h3>`), and so on. Never move forward more than one step at a time.

Newline for a new paragraph.


### Focus Order

Make sure that every page you tab through navigates logically. This is easier if you don't use a tab index with a value higher than 0. Creative application of CSS grid or flexbox can also cause the visual order to differ from that in the code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to massage this paragraph some, in that it may imply you want to use tabindex for focus order, instead of reading/DOM order.

Flex/grid order also is a bit of niche circumstance, so we might want to rephrase it as something to be on the lookout for to not do.

Do you want to make it completely easy for your visitor? Add a skip link. That is a (often hidden) link at the beginning of the page that allows you to "jump" to the content.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Do you want to make it completely easy for your visitor? Add a skip link. That is a (often hidden) link at the beginning of the page that allows you to "jump" to the content.
Do you want to make it completely easy for your visitor? Add a skip link. That is a (often hidden) link at the beginning of the page that allows you to "jump" to the content.

Jump to what content? Where? How often?

Maybe we also link to this post!


## Difficult to test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bit of a surprise in that there wasn't a companion "Easy to test" section before this one. Is that something we'd want to work in for the previous content?


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I try to do is not have a heading followed by another heading, as some folk might think there's missing content.

Can we have a segue sentence or tow to introduce the following content and why you consider it difficult?

### Variations of components

The more features a component has, the greater the chance that it will go wrong. If a component has a boolean attribute, dark mode and two responsive zoom levels, then you quickly end up with (2x2x3=8) eight variations that all need to be tested and maintained. So pay attention to this! If everyone around you has default dark mode on, you can count on issues in light mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we link to a good definition of what a boolean is, for folks who might not be familiar with the term?


### Composition

As soon as you start combining components, you can also foresee problems. You would prefer, for example, that forms have been developed and bundled as a complete system. You often combine the same components in forms. If they are delivered separately, unexpected (and untested) situations may arise. Another point of attention!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As soon as you start combining components

This is the first time we've really mentioned components. I'm thinking the intro might need a bit more detail to clarify what I'm guessing is the structure of the post.

Related to this is also the topic of relationships. Everything you tie together yourself is prone to errors. If you have a table of contents at the top of your page, you should pay close attention to how it is connected to the content of your page. Or how about a form (field) and an error message or instruction? You want relationships to be clear both visually and in code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want relationships to be clear both visually and in code.

How?


<figure role="figure" aria-label="The right parts in the wrong order.">
<img alt="A projector is attached to a wall. A projection screen is rolled up on the wall above it. The screen can't be rolled out, making it so the projector can't project on it." src="/img/posts/pitfalls-of-accessible-components/projector-and-screen.jpg" />
<figcaption>The right parts in the wrong order.</figcaption>
</figure>


### Website-wide

As mentioned earlier, components are good for consistency. If your set of components is not yet very mature or complete, this can still be a point of improvement.
For example, focus states can still differ between pages and components if this is not well thought out and implemented centrally.
Another point for improvement in the broader structure is often the navigability. You want pages to be found and accessed in more than one way. Think of a search function or sitemap next to your menu structure. Typically something you can't solve with a component. Make sure all your pages are part of this and are clearly represented.
Comment on lines +81 to +83
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As mentioned earlier, components are good for consistency. If your set of components is not yet very mature or complete, this can still be a point of improvement.
For example, focus states can still differ between pages and components if this is not well thought out and implemented centrally.
Another point for improvement in the broader structure is often the navigability. You want pages to be found and accessed in more than one way. Think of a search function or sitemap next to your menu structure. Typically something you can't solve with a component. Make sure all your pages are part of this and are clearly represented.
As mentioned earlier, components are good for consistency. If your set of components is not yet very mature or complete, this can still be a point of improvement.
For example, focus states can still differ between pages and components if this is not well thought out and implemented centrally.
Another point for improvement in the broader structure is often the navigability. You want pages to be found and accessed in more than one way. Think of a search function or sitemap next to your menu structure. Typically something you can't solve with a component. Make sure all your pages are part of this and are clearly represented.

Newlines for new paragraphs.


## Beyond the pitfalls

Now imagine watching out for all these pitfalls. Are you sure it's going to be okay? No Unfortunately! You can still choose the wrong component for example! You have no guarantee for an accessible end result. The chance that you will succeed with accessible components is many times greater than without!
Components are like the foundation of a house. Are you building on quicksand with crooked window frames? Good luck! A solid foundation with quality parts is what you want. But even with that you can build a house that falls short!
Comment on lines +87 to +88
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now imagine watching out for all these pitfalls. Are you sure it's going to be okay? No Unfortunately! You can still choose the wrong component for example! You have no guarantee for an accessible end result. The chance that you will succeed with accessible components is many times greater than without!
Components are like the foundation of a house. Are you building on quicksand with crooked window frames? Good luck! A solid foundation with quality parts is what you want. But even with that you can build a house that falls short!
Now imagine watching out for all these pitfalls. Are you sure it's going to be okay? No Unfortunately! You can still choose the wrong component for example! You have no guarantee for an accessible end result. The chance that you will succeed with accessible components is many times greater than without!
Components are like the foundation of a house. Are you building on quicksand with crooked window frames? Good luck! A solid foundation with quality parts is what you want. But even with that you can build a house that falls short!

Paragraphs.


![A curved and cornered wall with a baseboard. The baseboard is split up in separate pieces in a futile attempt to follow the shape of the wall.](/img/posts/pitfalls-of-accessible-components/baseboard.png)