Smashing Newsletter #306: Front-End Accessibility

With accessible toggles, navigation, disabled buttons, hidden content and media scroller component. Applicable to your projects right away. Issue #306 June 22, 2021 View in the browser 💨

Smashing Newsletter

Salut,

We’ve been covering front-end accessibility a few times already — it’s just one of the topics that are quite difficult to wrap your head around. We kept looking for reliable, accessible solutions and we’ve updated our complete guide to accessible front-end components, and we’ve just published a complete guide to accessibility tooling, too.

In today’s newsletter edition, we look into some of the accessibility issues that we haven’t tackled before: accessible toggles, navigation, disabled buttons, hidden content, media scroller component. With an overview of techniques to get them right when working on pretty much any project.

Image Optimization book
Meet “Image Optimization”, our new Smashing book for better image loading strategy. Photo by Marc Thiele.

In other news, we’ve just released Addy Osmani’s new book on “Image Optimization,” our new guide to improve your image loading strategy and be more deliberate and informed when dealing with images. The book is now shipping worldwide.

Beyond that, we hope that you’ll have a bit of time during the next couple of months to work a bit less, and perhaps spend more time outside with your family, friends and loved ones. It’s been such a rollercoaster time for all of us, so perhaps closing down that laptop for a little bit longer is quite a good idea.

Vitaly (@smashingmag)


1. Implementing Accessible Toggles

Toggles tend to be straightforward, yet they can bring along quite some accessibility pitfalls. To help you do better, Kitty Giraudel shares a tutorial for a small HTML- and CSS-only implementation of an accessible toggle that you can tweak at your own convenience.

An accessible toggle

The base for the accessible toggle is a properly-labelled checkbox. It conveys its status with both iconography and color and doesn’t leave any artifacts if CSS is not enabled. The toggle comes with native focus styles that can be customized, a disabled state, and it supports right-to-left orientation, too, if necessary. (cm)


2. Accessible Current Page Navigation State

Color is an effective way to convey meaning, but it’s always a good idea to have a second visual indicator for people with low vision or color vision deficiencies, too. An icon, for example. Callum Hart relies on a color/icon combination to indicate the page a user is currently on. In his blog post “An Accessible Current Page Navigation State”, he shares valuable insights into the considerations behind this design decision.

An Accessible Current Page Navigation State

From inlining the SVG icon in the HTML and using aria-hidden to hide it from assistive technologies to using ems instead of pixels and conveying additional context for screenreader users with the aria-current attribute, the post provides an in-depth look at how to cater for a truly accessible navigation state. (cm)


From our sponsor

Build In-Demand Skills In Northwestern’s Online MS In Information Design And Strategy

Work at the Intersection of Data, Design and Technology. Earn your master’s degree online at Northwestern Information Design and Strategy.
Earn your master’s degree online.


3. Making Skeletons More Accessible

Skeleton patterns tend to lack a meaningful way of presenting themselves to screen readers. They often use aria-busy="true" when a widget is loading, but only few screen readers actually honor the attribute. So how to do better?

More Accessible Skeletons

As Adrian Roselli suggests, you could use CSS to find any node with aria-busy="true" and set it to display: none to achieve the same effect for screen reader and non-screen-reader users. In his article “More Accessible Skeletons”, he takes you through the process step by step. The demo works across browsers with current releases of JAWS, NVDA, VoiceOver, and TalkBack. (cm)


4. Upcoming Smashing Online Events

Direct from the Smashing family, we are very proud and honored to invite you to our upcoming online event — Smashing Meetsthe CSSummer edition. The event will take place online, on July 8th, with sessions by Miriam Suzanne and Ahmad Shadeed on what’s happening in CSS — with a particular focus on CSS container queries. We’d love to see you there, as it will be good fun, of course!

Smashing Online Events
Web dev and design can sometimes feel like you’re riding some pretty wild waves! We’ve got your back with personal and inclusive events.

In general, web performance is pretty much at the heart of the online workshops that we run here at Smashing — whether it’s around accessibility, design or front-end.

For the next workshops, we have coming up:


5. A Way Forward To More Inclusive Disabled Buttons

There are some use cases where disabled buttons make sense. When adding a number of tickets to a shopping cart, for example, you might want to disable the “Add to cart” button if there are not tickets to add to the cart. That’s the example that Sandrina Pereira uses to illustrate how we can improve disabled buttons to make them more inclusive.

Making Disabled Buttons More Inclusive

As Sandrina shows in her article on CSS-Tricks, the common way of using <button disabled> prevents not only the click but also the focus. While this might seem harmless, it causes confusion for screen reader users. Swapping disabled with aria-disabled makes the experience more enjoyable: although marked disabled, the button is still accessible by focus and it can trigger a tooltip, too. (cm)


From our friends

Subscribe for Emerging Tech News ☕

Stay Up To Date On Emerging Tech

Emerging Tech Brew Newsletter is packed with tech insights to make you smarter in 5 minutes, 3 times a week. That’s why it’s trusted by 275,000+ techies from organizations like Amazon, AppDynamics, Honeywell, Intel, Magic Leap, Salesforce, Verizon, and more. This week, Senator Jeff Merkley retweeted their scoop about a US Federal facial recognition ban.

Satisfy your curiosity. Make better business decisions. Subscribe now.


6. How To Hide Content Responsibly

How do you hide content responsibly to make it invisible but still accessible for screen readers? Kitty Giraudel summarized different ways of hiding something, be it with HTML or CSS, and when to use which.

Hiding Content Responsibly

As Kitty suggests, you might want to avoid having too many discrepancies between the visual content and the underlying content exposed to the accessibility layer. The more they are in sync, the better. Kitty defines three different scenarios to help you assess when to use which technique: If you need to hide something both visually and from the accessibility tree (show/hide widgets, offscreen navigation, or a closed dialog, for example), use display: none or the hidden HTML attribute.

If you need to hide something from the accessibility tree but keep it visible, use aria-hidden="true" (valid cases are visual content void of meaning, icons). And, last but not least, if you want to hide something but keep it accessible, use the visually hidden CSS declaration group (e.g., for complementary content that provides more context, such as for icon buttons or links). A great overview. (cm)


7. A Smooth, Responsive Media Scroller Component

How would you go about creating a responsive media scroller component that works on TVs, phones, and desktops alike? Adam Argyle takes you through the process step by step.

Building A Media Scroller Component

Designed to host thumbnails of media or products, the scroller component is built upon a <ul> with accessible markup. CSS transforms the humble list into a smooth scroll experience that showcases the images and snaps them to a grid.

To add some finesse, JavaScript facilitates roving-index interactions, helping keyboard users skip traversing a large number of items, and, last but not least, the experimental prefers-reduced-data media query turns the media scroller into a lightweight experience, if necessary. Clever! (cm)


8. New On Smashing Job Board


9. Our Recent Articles

Sent to truly smashing readers via Mailchimp.
We sincerely appreciate your kind support. You
rock.

Follow us on Twitter Join us on Facebook

unsubscribe update preferences view in your browser

Older messages

Meet Image Optimization, A New Smashing Book

Thursday, June 17, 2021

Meet Addy Osmani's new book on image optimization: from formats and compression to delivery and maintenance. Brand new book: Image Optimization by Addy Osmani. Dearest Friend, How do we deliver

Smashing Newsletter #305: Color Palettes Generators and Tools

Tuesday, June 15, 2021

With CSS variables, HSLA, color generators, color combinations and color scales for data visualizations. Issue #305 • June 15, 2021 • View in the browser 💨 Smashing Newsletter Ciao Amici, Color may

Smashing Newsletter #304: Front-End Boilerplates and Starter Kits

Tuesday, June 8, 2021

With reliable CSS/JavaScript boilerplates for all kinds of projects, from static site templates to React/Vue starter kits.Issue #304 • June 8, 2021 • View in the browser 💨 Smashing Newsletter Unjani

Smashing Newsletter #303: VS Code Extensions

Tuesday, June 1, 2021

With useful VS Code extensions and little tools to help you save time and avoid headache when writing code. Issue #303 • June 1, 2021 • View in the browser 💨 Smashing Newsletter Namaste Smashing

Smashing Newsletter #302: Figma Plugins and Tools

Tuesday, May 25, 2021

With new features in Figma, useful Figma plugins, a template for Figma wayfinding, simpler annotations and integration with Vue.js, and how to manage design systems in Figma. Issue #302 • May 25, 2021

You Might Also Like

Car UX, DevTools Tips, CSS Patterns, iOS404, Internet Cables

Thursday, April 18, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 18 2024 Steering the future: a new vision for car UX

Big Tents, Pistachio Palettes, and Other Late-Breaking Milan Discoveries

Wednesday, April 17, 2024

View in your browser | Update your preferences We've had a remodel! From now on, you'll be hearing from AD PRO in your inbox twice a week—once with a deep dive into trends to watch and subjects

163 / Dieter Rams inspired Framer components, America's national parks and more free resources…

Wednesday, April 17, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Apr 2024 • Part 1 View in browser Welcome to Issue 163! I'm comfortable talking to a human on camera, but talking at the camera, not so much. The

Logo System, BCWA Identity, War Robots, 84—24, 19th-Century Atlas

Wednesday, April 17, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 17 2024 Logo System: Explore 400+ logo designs logosystem

Emma Roberts's Home: AD100 Firm Pierce & Ward Share Their Secret Sources

Tuesday, April 16, 2024

Plus, the best exterior house colors View in your browser | Update your preferences Architectural Digest AD PRO Logo exterior of two residential buildings painted with blue trim with a brick patio and

#452: Design Workflow

Tuesday, April 16, 2024

How to choose the right idea, navigate difficult conversations and communicate design. Issue #452 • Apr 16, 2024 • View in the browser Smashing Newsletter Iyi akşamlar Smashing Friends, Design workflow

Mario & Pareto, faces.js, Sleep vs Blog, Dark Mode, DOM Folding

Tuesday, April 16, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 16 2024 Mario meets Pareto mayerowitz.io Discover how to

Gap, Teenagers, Artistic Intelligence, Should Designers Code, CSS in RSCs

Tuesday, April 16, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 15 2024 Gap is the new Margin frontendmasters.com In 2020

How to Combat Allergies at Home—Designers Weigh In

Monday, April 15, 2024

Plus, 5 gorgeous greenhouses from the AD Archive View in your browser | Update your preferences Architectural Digest AD PRO Logo a conservatory-style greenhouse at the back of a lush floral garden

Accessibility Weekly #392: Socks, Lies, and Accessibility

Monday, April 15, 2024

April 15, 2024 • Issue #392 View this issue online or browse the full issue archive. Featured: Socks, lies, and accessibility "Global Accessibility Awareness Day (GAAD) is around the corner.