Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Accessibility tips & tricks for CSS developers
Search
Marco Solazzi
March 25, 2016
Programming
1
420
Accessibility tips & tricks for CSS developers
Marco Solazzi
March 25, 2016
Tweet
Share
More Decks by Marco Solazzi
See All by Marco Solazzi
Automation Strategies for Baseline Accessibility - Merpay Tech Talk 2021
dwightjack
0
310
Inclusive UI development tips & tricks
dwightjack
0
190
CSS Workflow for Grown-ups
dwightjack
1
430
Introducing AngularJS - Frontenders Verona
dwightjack
0
610
Other Decks in Programming
See All in Programming
How to use Macrobenchmark
veronikapj
0
160
DMMプラットフォームにおけるTiDBの導入から運用まで
pospome
7
3k
さきがけから振り返るアーキテクチャ刷新 / Reflecting on the Architectural Renewal from the Vanguard
nrslib
2
780
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
MIERUNE BBQにおけるユーザー中心設計()
mierune
PRO
1
110
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
Namespace on read
tagomoris
2
370
CSC307 Lecture 08
javiergs
PRO
0
330
[After Kotlin Fest 2024 LT Night @ Sansan] もっともっとKotlinを好きになる!K2 Compiler Pluginで遊んでみよう!
kitakkun
2
260
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
310
Polarsの成長: v0.14からv1.0までの変遷と今後の展望
zerebom
1
350
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
How to Ace a Technical Interview
jacobian
274
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
2.9k
The Invisible Customer
myddelton
117
13k
Automating Front-end Workflow
addyosmani
1362
200k
It's Worth the Effort
3n
181
27k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Adopting Sorbet at Scale
ufuk
71
8.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
Why Our Code Smells
bkeepers
PRO
332
56k
Transcript
Accessibility tips & tricks for CSS developers Marco Solazzi -
@dwightjack CSS Day 2016 - cssday.it
About me - Senior Front-end @ AQuest - Co-founder Frontenders
Verona
HTML semantics Progressive enhancement Mobile first Responsive UX
“ … enabling as many people as possible to use
Web sites, even when those people's abilities are limited in some way. ” Accessibility https://developer.mozilla.org/en-US/docs/Web/Accessibility
“ … enabling as many people as possible to use
Web sites, even when those people's abilities are limited in some way. ” Accessibility - https://developer.mozilla.org/en-US/docs/Web/Accessibility
If you follow best practices you’re already providing some accessibility
- vision impairments - limited fine motor control - cognitive
disabilities - hearing impairments - older people (ourselves tomorrow) For whom?
Because we have to. Goverments are enforcing accessibility by legislation.
Why? - US: List of Web Accessibility-Related Litigation and Settlements (http://bit.ly/1n1JkQl) - IT: Legge Stanca (https://it.wikipedia.org/wiki/Legge_Stanca)
Because we should. Why?
“I’m going to do the website that way. If people
can’t use it they can go f**k themselves!” Everyday rant... - random world class designer / developer
“I’m going to put stairs here. If people can’t climb
them they can go f**k themselves!” What if... - random world class architect
Websites are like shops, restaurants and theatres: if you leave
me out you don’t deserve my money.
- unreadable beauty - table syndrome - outline dilemma -
out of sight... How?
Unreadable beauty
- blindness - low vision - color blindness Unreadable beauty
Unreadable beauty award-winning flash site, mid 2000
Unreadable beauty award-winning flash site, mid 2000
Unreadable beauty award-winning HTML site, mid 2010
Unreadable beauty award-winning HTML site, mid 2010
1. set html font-size to 100% 2. use rem fonts
and em media queries 3. high-contrast optional theme Unreadable beauty
1. set html font-size to 100% 2. use rem fonts
and em media queries 3. high-contrast optional theme Bonus: Use currentColor for flexible theming Unreadable beauty
Unreadable beauty
Unreadable beauty
Table syndrome
Every tag has its place in the world document.
Every tag has its place in the world document. …
even <ruby> - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby
<table>s are evil! Let’s use <div>s … and display: table
Table syndrome
<table>s are evil! Let’s use <div>s … and display: table
Problems: 1. not semantic 2. unannounced by screen-readers Table syndrome
<button>s are ugly! Let’s use <span>s and <a>s with JS
Table syndrome
<button>s are ugly! Let’s use <span>s and <a>s with JS
Problems: 1. missing focus 2. different/missing keyboard interactions Table syndrome
Table syndrome
Table syndrome
Outline dilemma
“ … provides visual feedback for links that have "focus"
when navigating a web document using the TAB key (or equivalent). ” Outline dilemma - http://www.outlinenone.com
“ … provides visual feedback for links that have "focus"
when navigating a web document using the TAB key (or equivalent). ” - http://www.outlinenone.com Outline dilemma
default outlines are ugly! - http://meyerweb.com/eric/tools/css/reset/reset200802.css Outline dilemma
default outlines are ugly! - http://meyerweb.com/eric/tools/css/reset/reset200802.css Outline dilemma
Outline dilemma
Outline dilemma
Outline dilemma
If you really can’t stand outline, remove it just for
mouse / touch interactions. Outline dilemma - https://github.com/lindsayevans/outline.js - https://www.paciellogroup.com/blog/2012/04/how-to-remove-css-outlines-in-an- accessible-manner/
Out of sight
How many ways to hide something? 1. opacity: 0 2.
visibility: hidden 3. display: none Out of sight
How many ways to hide something? 1. opacity: 0 2.
visibility: hidden 3. display: none ← accessibility friendly Out of sight
Options for element transitions: 1. display: none onComplete 2. tabindex=”-1”
for every link / button Out of sight
Don’t speak bonus:
Don’t speak
Don’t speak Warning: totally unreliable!
Don’t speak Always prefer SVGs (even for icons)
I want more! Resources - http://a11yproject.com/ - https://www.paciellogroup.com/ - http://webaim.org/
- http://a11yweekly.com/ People - https://twitter.com/LeonieWatson - https://twitter.com/stevefaulkner
Thanks