Skip to main content

Form styling limitations are an accessibility issue

Posted in Accessibility, CSS and Development

I enjoyed a brief summary of the things people are looking for in CSS from Chris Coyier on CSS-Tricks:

Just clicking the reload button a bunch, I get the sense that the top answers are:

  • Container Queries
  • Parent Selectors
  • Nesting
  • Something extremely odd that doesn’t really make sense and makes me wonder about people

So I visited the What’s missing from CSS site and hit the reload button.

What Chris doesn’t mention, which I saw a couple of times, was form styling. There are a few key form elements that are difficult/impossible to style, and even require a lot of extra markup and some seriously hacky CSS. I’m thinking of <option>s in <select> and <datalist> elements, <input type="file" />.

I wonder how much <div>-based, ARIA-fuelled (if we’re lucky) custom-built alternatives could have been avoided if we had just been able to style those problem elements easily in CSS cross-browser?

I’ve noticed a fair bit of noise about this lately, including:

Just the other week, in fact, Stephanie Stimac from the Open UI Project wrote for Smashing Magazine about plans to make those problematic form controls more stylable:

The ultimate goal is to provide developers with a high degree of flexibility over appearance and extensibility of controls

Hopefully we’ll see browsers start to allow deeper custom styling of these problematic elements, so that designers can better rely on what the browser provides, and developers can use all of the out-of-the box accessibility benefits and lack of technical debt that using native HTML brings.

Accessibility in your inbox

I send an accessibility-centric newsletter on the last day of every month, containing:

  • A roundup of the articles I’ve posted
  • A hot pick from my archives
  • Some interesting posts from around the web

I don’t collect any data on when, where or if people open the emails I send them. Your email will only be used to send you newsletters and will never be passed on. You can unsubscribe at any time.

More posts

Here are a couple more posts for you to enjoy. If that’s not enough, have a look at the full list.

  1. Using iframes to embed arbitrary content is probably a bad idea

    The iframe element is a way to embed one website inside of another. Useful for things like maps or videos, but not so much for other content.

  2. Avatars and alt text

    I really enjoyed Nicolas Steenhout’s recent article on Alt text for avatars or user photos. But there is a context where I would break his rule…