You are here


Accessibility: where to put the search role when your search form is hidden

I've worked on several sites recently where the site search form is hidden by default and displayed by activating a button. This pattern caused me a bit of confusion about where to put the role="search" attribute, which is important for accessibility.

According to the W3C specification the search role is:

A landmark region that contains a collection of items and objects that, as a whole, combine to create a search facility.

Browsing the web as a developer

I've been maintaining or building websites since September of 1999. At the time of this writing, that's almost 20 years.

One of my main focuses as a web developer is usability/accessibility—making the sites I build intuitive, easy to understand and operate, and accessible to all users, including those with disabilities, as much as possible.

Add visually hidden file type indicator to file field links - Drupal 8

I'm working on a website which has icons on file upload links, like so:

PDF file links with icons

This is nice for people who can see the icons, but what about those who can't? Accessibility means giving all users an equivalent experience, regardless of how they're accessing the site.

If the icons were inline images, we could put an alt of "PDF" on them and be done. However, in this case, they're background images.