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.

Get them delivered!

If you enjoyed this and want all the latest articles delivered to your inbox every month, pop your email in the form below.

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. The difference between strikethrough and del

    Just like <em> and <i>, and <strong> and <b>, the distinction between <s> and <del> is subtle, but it’s worth knowing.

  2. Git restore to discard changes

    I no longer use git checkout to switch branches; I’ve also stopped using it to discard uncommitted changes: let me introduce git restore!