SlideShare una empresa de Scribd logo
1 de 63
Rethinking Accessibility
Related Best Practices
for CSS in the Modern
Age
Shwetank Dixit
Head – Accessibility Innovation and Research
BarrierBreak
About BarrierBreak
• Based in Mumbai, India.
• Accessibility auditing, tools and training.
• For profit enterprise with a social mission.
• One of the pioneers of accessibility
awareness in India.
• About 70-75% of our employees have a
disability of some kind.
About Me
• Head of Innovation and Research at
BarrierBreak
• Co-Editor of the HTML5 specification at W3C.
• Part of Web Platform WG, AGWG and more.
• Google Developer Expert.
• Previously at Opera as PM of Extensions and
part of Developer Relations.
Do you think this pie chart is
accessible?
Trends in web design
The web is growing more aesthetically pleasing, but at what cost?
Subtle
colors
• Unfortunately not caring about
contrast
• Some sites have a looping video
as a background, but with text
on top of it.
Gradients
Gradients are pretty popular as backgrounds too.
If care isn’t taken for proper contrast, then it makes it hard (and sometimes
impossible) to read.
Parallax
• Common design pattern in many
websites
• Sometimes the transitions are
too fast or cover too much of
the screen, causing strain.
Information online
We have a bunch of information online on accessibility for HTML, ARIA,
JavaScript etc.
CSS
Not too many people talk about these when talking accessibility
The inspiration for this talk
topic
BarrierBreak
CSS
Accessibility
Extension
CSS Techniques for WCAG
2.0
Inspiration
• BarrierBreak CSS Accessibility Extension
• CSS Techniques for WCAG 2.0
Color Contrast
Does this dress
look white and
gold? Or black
and blue?
Lots of controversy of the
color scheme of this
dress
It even had it’s own wikipedia page
WCAG 2.0, Section 1.4.1
Color is not used as the only visual means of conveying information,
indicating an action, prompting a response, or distinguishing a visual
element. (Level A)
WCAG 2.0, Section 1.4.1
(Continued)
Color is not used as the only visual means of conveying information,
indicating an action, prompting a response, or distinguishing a visual
element. (Level A)
WCAG 2.1, Section
1.4.11
The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s):
User Interface Components
Visual information used to indicate states and boundaries of user interface components, except for
inactive components or where the appearance of the component is determined by the user agent and not
modified by the author;
Graphical Objects
Parts of graphics required to understand the content, except when a particular presentation of graphics
is essential to the information being conveyed.
AT RISK!!!
Tools I use
• Contrast (Mac Paid App)
• Chrome Canary Devtools (Free) + Google Developer Accessibility Tools
Extension
• There are a number of similar tools which do pretty much the same
thing. It’s a matter of preference.
New in Chrome 65 (Canary as of now)
Open up color picker in devtools. Get color picker which can analyze color contrast ratio.
Chrome Accessibility Developer Tools
Extension
• Inspect Element -> Accessibility Properties -> Color Contrast Ratio
Sample Text
Sample Text
Font-Size
Can I just px already?
This debate got a lot of talk a while
ago
Source: https://hackernoon.com/rems-and-ems-and-why-you-probably-dont-need-them-
664b9ce1e09f
“My point: you don’t need in depth knowledge
and fancy tools for working out if rems and
ems are ‘better for accessibility’ — just imagine
that you are someone with bad eyesight”
Quote from the article - 1
“The above facts, to me, make it crystal clear
that browser text size adjustment is of no use
in the real world. And so I will not take this
setting into account in my decision
making process.”
Quote from the article - 2
With points and counter points
Source: https://medium.com/@jpdevries/rems-and-ems-and-why-you-probably-
need-them-ff99a0002cdd
Zooming
Not all devices implement zooming the same way
Browser zoom != font size preference
Zooming – watch out for
• Older browsers
• Televisions
• Some mobile browsers like Opera for Android (Text
reflow)
Views from a CSS WG member
Link to above screenshot on the web
CSS background
Images
Only for presentational content
Upcoming: CSS Paint
API
Generate presentational graphics using JS instead of using an image via
`url()`
Tutorial: https://developers.google.com/web/updates/2018/01/paintapi
CSS User Queries
Like media queries, but for the user’s preferences instead
Vestibular Disorder
Feeling of dizziness and nauseousness when large parts of the UI move
quickly.
Parallax
• Common design pattern in many
websites
• Sometimes the transitions are
too fast or cover too much of
the screen, causing strain.
Vestibular Disorder – causes (on the
web)
• Many sites have parallax based designs, which can tend to cause
discomfort to people with vestibular disorders.
• Can also be caused by certain animations moving quickly in the page.
prefers-reduced-motion
• Apply different styles for user’s who prefer reduced motion.
• Currently Safari only.
@media(prefers-reduced-motion){
...
}
prefers-reduced-motion
(continued)
• Listen if the user has changed preference for reduced motion at the OS
level
• Adjust UI accordingly
var reducedMotionQuery = matchMedia('(prefers-reduced-motion)');
function handleReduceMotionChangeEvent() {
if (motionQuery.matches) {
/*User has enabled 'reduced motion' preferences in the OS*/
/* adjust motion of 'transition' or 'animation' properties */
} else {
/* display animation with standard speed. Default UI elements. */
}
}
recuedMotionQuery.addListener(handleReduceMotionChangeEvent);
handleReduceMotionChanged();
Reduced motion – Things to keep in
mind
• Don’t disable or reduce all animation.
• Some animation might be essential to understanding the content
properly.
• Only reduce animation or movement of UI elements which are likely
to cause vestibular issues.
• Listen to user feedback on it.
Inverted colors
• This allows you to have apply a exclusive set of CSS which is only there for
people who have switched on inverted colors on the OS level.
• Safari only currently.
• Typical use case is for images, since inverted colors inverts images too.
@media (inverted-colors) {
...
}
Page as it appears by default
Page when colors are inverted, but
custom CSS is not applied
Page with optimal look on high
contrast
@media (inverted-colors) {
img {
filter: invert();
}
}
Windows High-Contrast Mode
@media (-ms-high-contrast: active) {}
@media (-ms-high-contrast: black-on-white) {}
@media (-ms-high-contrast: white-on-black) {}
Windows High-Contrast Mode -
Continued
Text is mapped to windowText
Hyperlinks is mapped to N/A, we apply
the color to <a>
Selected Text is mapped to highlightText
& highlight
Button Text is mapped to buttonFace
Background is mapped to window
Are we with the times?
1.3.2 - Meaningful Sequence
Level A
When the sequence in which content is presented affects
its meaning, a correct reading sequence can be
programmatically determined.
AKA,
DOM order should match visual
order
Additional Info: https://www.w3.org/WAI/GL/WCAG20-TECHS/css.html#C27
Can we?
In the age of Flexbox and CSS
Grid?
Flexbox (unchanged order
example)
<div class="flex">
<div class="item-one">
...
</div>
<div class="item-two">
...
</div>
</div>
.flex {
display: flex;
flex-direction: column;
}
Flexbox (changed order
example)
<div class="flex">
<div class="item-one">
...
</div>
<div class="item-two">
...
</div>
</div>
.flex {
display: flex;
flex-direction: column;
}
.item-one {
order: 1;
}
CSS Grid (unchanged order)
CSS Grid (changed order)
Ordering in the real world
While this should be the case, and we should push
for it ... in the real world, we need to see how
practical this advice is.
Source: https://www.w3.org/TR/css-flexbox-1/#order-accessibility
Firefox’s Flexbox ‘bug’
Firefox used to have a ‘bug’, where if the visual order is changed with flexbox,
the keyboard navigation followed the visual order instead of the DOM order.
This turned out to be good, even though its technically a bug which violated
the spec.
Firefox’s Flexbox ‘bug’
(continued)
It’s since been ‘fixed’ and now firefox’s behavior matches other
browsers.
How to fix problem of visual order not
matching focus
• This is a problem which needs fixing from the browsers as well as
somewhere in the specs
• I proposed an attribute which could specify how order should behave
(by default matching DOM order, but can be changed to match visual)
• Current debate whether we need a CSS fix for it or an HTML attribute
for it.
• Read more and comment on the WICG page for it.
Thanks!
• Shwetank Dixit
• shwetank@barrierbreak.com
• @shwetank
Further Reading and resources
• BarrierBreak CSS Accessibility Extension
• Accessibility Developer Tools Chrome Extension
• CSS Techniques for WCAG 2.0
• Google Web Fundamentals Tutorial on the CSS Paint API
• JP de Vries article: Rems, ems and why you probably need them
• Greg Whitworth’s article on how to use –ms-high-contrast
• The webkit.org article on responsive design for motion
• Leonie Watson on the Flexbox and Keyboard navigation disconnect.
• Proposal for a new HTML attribute (or CSS entry) for allowing DOM order to
follow visual order.

Más contenido relacionado

La actualidad más candente

OOP Approach to Design
OOP Approach to DesignOOP Approach to Design
OOP Approach to Designaxe777
 
Early prevention of accessibility issues with mockup & wireframe reviews
Early prevention of accessibility issues with mockup & wireframe reviewsEarly prevention of accessibility issues with mockup & wireframe reviews
Early prevention of accessibility issues with mockup & wireframe reviewsAidan Tierney
 
Improving joomla's backend user experience
Improving joomla's backend user experienceImproving joomla's backend user experience
Improving joomla's backend user experienceLuke Summerfield
 
Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Courtney Jordan
 
Front end development best practices
Front end development best practicesFront end development best practices
Front end development best practicesKarolina Coates
 
Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolboxSkysoul Pty.Ltd.
 
Designing Powerful Web Applications Using AJAX and Other RIAs
Designing Powerful Web Applications Using AJAX and Other RIAsDesigning Powerful Web Applications Using AJAX and Other RIAs
Designing Powerful Web Applications Using AJAX and Other RIAsDave Malouf
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project ReportMJ Ferdous
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5Jeff Byrnes
 

La actualidad más candente (12)

OOP Approach to Design
OOP Approach to DesignOOP Approach to Design
OOP Approach to Design
 
Early prevention of accessibility issues with mockup & wireframe reviews
Early prevention of accessibility issues with mockup & wireframe reviewsEarly prevention of accessibility issues with mockup & wireframe reviews
Early prevention of accessibility issues with mockup & wireframe reviews
 
Improving joomla's backend user experience
Improving joomla's backend user experienceImproving joomla's backend user experience
Improving joomla's backend user experience
 
Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!Responsive Design: Let's get Responsive!
Responsive Design: Let's get Responsive!
 
Template frameworks
Template frameworksTemplate frameworks
Template frameworks
 
Jquery mobile
Jquery mobileJquery mobile
Jquery mobile
 
Front end development best practices
Front end development best practicesFront end development best practices
Front end development best practices
 
Javascript library toolbox
Javascript library toolboxJavascript library toolbox
Javascript library toolbox
 
Designing Powerful Web Applications Using AJAX and Other RIAs
Designing Powerful Web Applications Using AJAX and Other RIAsDesigning Powerful Web Applications Using AJAX and Other RIAs
Designing Powerful Web Applications Using AJAX and Other RIAs
 
jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
Web Design Project Report
Web Design Project ReportWeb Design Project Report
Web Design Project Report
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5
 

Similar a Rethinking accessibility related best practices for CSS in the modern age

Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Bootstrap for Beginners
Bootstrap for BeginnersBootstrap for Beginners
Bootstrap for BeginnersD'arce Hess
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issuesNeil Perlin
 
Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Frédéric Harper
 
The future of BYU web design
The future of BYU web designThe future of BYU web design
The future of BYU web designNate Walton
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013Marc D Anderson
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignCantina
 
Plan For Accessibility - TODCon 2008
Plan For Accessibility - TODCon 2008Plan For Accessibility - TODCon 2008
Plan For Accessibility - TODCon 2008Denise Jacobs
 
Responsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonResponsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonDhrubaJyoti Dey
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hatNeil Perlin
 
Startup Institute NYC: Styling
Startup Institute NYC: StylingStartup Institute NYC: Styling
Startup Institute NYC: StylingMatthew Gerrior
 
Customizing ERModernLook Applications
Customizing ERModernLook ApplicationsCustomizing ERModernLook Applications
Customizing ERModernLook ApplicationsWO Community
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxchitrachauhan21
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Henny Swan
 
EXPERTALKS: Sep 2013 - Responsive Web Design
EXPERTALKS: Sep 2013 - Responsive Web DesignEXPERTALKS: Sep 2013 - Responsive Web Design
EXPERTALKS: Sep 2013 - Responsive Web DesignEXPERTALKS
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
Accessibility patterns testable requirements during early design
Accessibility patterns testable requirements during early designAccessibility patterns testable requirements during early design
Accessibility patterns testable requirements during early designAidan Tierney
 

Similar a Rethinking accessibility related best practices for CSS in the modern age (20)

Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Bootstrap for Beginners
Bootstrap for BeginnersBootstrap for Beginners
Bootstrap for Beginners
 
Stc 2015 preparing legacy projects for responsive design - technical issues
Stc 2015   preparing legacy projects for responsive design - technical issuesStc 2015   preparing legacy projects for responsive design - technical issues
Stc 2015 preparing legacy projects for responsive design - technical issues
 
Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18Responsive Web Design - Web & PHP Conference - 2013-09-18
Responsive Web Design - Web & PHP Conference - 2013-09-18
 
The future of BYU web design
The future of BYU web designThe future of BYU web design
The future of BYU web design
 
SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013SEF 2014 - Responsive Design in SharePoint 2013
SEF 2014 - Responsive Design in SharePoint 2013
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Mobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web DesignMobile Monday Presentation: Responsive Web Design
Mobile Monday Presentation: Responsive Web Design
 
Plan For Accessibility - TODCon 2008
Plan For Accessibility - TODCon 2008Plan For Accessibility - TODCon 2008
Plan For Accessibility - TODCon 2008
 
Responsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparisonResponsive web design with various grids and frameworks comparison
Responsive web design with various grids and frameworks comparison
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hat
 
Startup Institute NYC: Styling
Startup Institute NYC: StylingStartup Institute NYC: Styling
Startup Institute NYC: Styling
 
Customizing ERModernLook Applications
Customizing ERModernLook ApplicationsCustomizing ERModernLook Applications
Customizing ERModernLook Applications
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptxLATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
 
Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?Is the mobile web enabled or disabled by design?
Is the mobile web enabled or disabled by design?
 
EXPERTALKS: Sep 2013 - Responsive Web Design
EXPERTALKS: Sep 2013 - Responsive Web DesignEXPERTALKS: Sep 2013 - Responsive Web Design
EXPERTALKS: Sep 2013 - Responsive Web Design
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Accessibility patterns testable requirements during early design
Accessibility patterns testable requirements during early designAccessibility patterns testable requirements during early design
Accessibility patterns testable requirements during early design
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Rethinking accessibility related best practices for CSS in the modern age

  • 1. Rethinking Accessibility Related Best Practices for CSS in the Modern Age Shwetank Dixit Head – Accessibility Innovation and Research BarrierBreak
  • 2. About BarrierBreak • Based in Mumbai, India. • Accessibility auditing, tools and training. • For profit enterprise with a social mission. • One of the pioneers of accessibility awareness in India. • About 70-75% of our employees have a disability of some kind.
  • 3. About Me • Head of Innovation and Research at BarrierBreak • Co-Editor of the HTML5 specification at W3C. • Part of Web Platform WG, AGWG and more. • Google Developer Expert. • Previously at Opera as PM of Extensions and part of Developer Relations.
  • 4. Do you think this pie chart is accessible?
  • 5. Trends in web design The web is growing more aesthetically pleasing, but at what cost?
  • 6. Subtle colors • Unfortunately not caring about contrast • Some sites have a looping video as a background, but with text on top of it.
  • 7. Gradients Gradients are pretty popular as backgrounds too. If care isn’t taken for proper contrast, then it makes it hard (and sometimes impossible) to read.
  • 8. Parallax • Common design pattern in many websites • Sometimes the transitions are too fast or cover too much of the screen, causing strain.
  • 9. Information online We have a bunch of information online on accessibility for HTML, ARIA, JavaScript etc.
  • 10. CSS Not too many people talk about these when talking accessibility
  • 11. The inspiration for this talk topic
  • 13. CSS Techniques for WCAG 2.0
  • 14. Inspiration • BarrierBreak CSS Accessibility Extension • CSS Techniques for WCAG 2.0
  • 16. Does this dress look white and gold? Or black and blue?
  • 17. Lots of controversy of the color scheme of this dress
  • 18. It even had it’s own wikipedia page
  • 19. WCAG 2.0, Section 1.4.1 Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. (Level A)
  • 20. WCAG 2.0, Section 1.4.1 (Continued) Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. (Level A)
  • 21. WCAG 2.1, Section 1.4.11 The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): User Interface Components Visual information used to indicate states and boundaries of user interface components, except for inactive components or where the appearance of the component is determined by the user agent and not modified by the author; Graphical Objects Parts of graphics required to understand the content, except when a particular presentation of graphics is essential to the information being conveyed. AT RISK!!!
  • 22. Tools I use • Contrast (Mac Paid App) • Chrome Canary Devtools (Free) + Google Developer Accessibility Tools Extension • There are a number of similar tools which do pretty much the same thing. It’s a matter of preference.
  • 23. New in Chrome 65 (Canary as of now) Open up color picker in devtools. Get color picker which can analyze color contrast ratio.
  • 24. Chrome Accessibility Developer Tools Extension • Inspect Element -> Accessibility Properties -> Color Contrast Ratio
  • 27. Font-Size Can I just px already?
  • 28. This debate got a lot of talk a while ago Source: https://hackernoon.com/rems-and-ems-and-why-you-probably-dont-need-them- 664b9ce1e09f
  • 29. “My point: you don’t need in depth knowledge and fancy tools for working out if rems and ems are ‘better for accessibility’ — just imagine that you are someone with bad eyesight” Quote from the article - 1
  • 30. “The above facts, to me, make it crystal clear that browser text size adjustment is of no use in the real world. And so I will not take this setting into account in my decision making process.” Quote from the article - 2
  • 31. With points and counter points Source: https://medium.com/@jpdevries/rems-and-ems-and-why-you-probably- need-them-ff99a0002cdd
  • 32. Zooming Not all devices implement zooming the same way
  • 33. Browser zoom != font size preference
  • 34. Zooming – watch out for • Older browsers • Televisions • Some mobile browsers like Opera for Android (Text reflow)
  • 35. Views from a CSS WG member Link to above screenshot on the web
  • 36. CSS background Images Only for presentational content
  • 37. Upcoming: CSS Paint API Generate presentational graphics using JS instead of using an image via `url()` Tutorial: https://developers.google.com/web/updates/2018/01/paintapi
  • 38. CSS User Queries Like media queries, but for the user’s preferences instead
  • 39. Vestibular Disorder Feeling of dizziness and nauseousness when large parts of the UI move quickly.
  • 40. Parallax • Common design pattern in many websites • Sometimes the transitions are too fast or cover too much of the screen, causing strain.
  • 41. Vestibular Disorder – causes (on the web) • Many sites have parallax based designs, which can tend to cause discomfort to people with vestibular disorders. • Can also be caused by certain animations moving quickly in the page.
  • 42. prefers-reduced-motion • Apply different styles for user’s who prefer reduced motion. • Currently Safari only. @media(prefers-reduced-motion){ ... }
  • 43. prefers-reduced-motion (continued) • Listen if the user has changed preference for reduced motion at the OS level • Adjust UI accordingly var reducedMotionQuery = matchMedia('(prefers-reduced-motion)'); function handleReduceMotionChangeEvent() { if (motionQuery.matches) { /*User has enabled 'reduced motion' preferences in the OS*/ /* adjust motion of 'transition' or 'animation' properties */ } else { /* display animation with standard speed. Default UI elements. */ } } recuedMotionQuery.addListener(handleReduceMotionChangeEvent); handleReduceMotionChanged();
  • 44. Reduced motion – Things to keep in mind • Don’t disable or reduce all animation. • Some animation might be essential to understanding the content properly. • Only reduce animation or movement of UI elements which are likely to cause vestibular issues. • Listen to user feedback on it.
  • 45. Inverted colors • This allows you to have apply a exclusive set of CSS which is only there for people who have switched on inverted colors on the OS level. • Safari only currently. • Typical use case is for images, since inverted colors inverts images too. @media (inverted-colors) { ... }
  • 46. Page as it appears by default
  • 47. Page when colors are inverted, but custom CSS is not applied
  • 48. Page with optimal look on high contrast @media (inverted-colors) { img { filter: invert(); } }
  • 49. Windows High-Contrast Mode @media (-ms-high-contrast: active) {} @media (-ms-high-contrast: black-on-white) {} @media (-ms-high-contrast: white-on-black) {}
  • 50. Windows High-Contrast Mode - Continued Text is mapped to windowText Hyperlinks is mapped to N/A, we apply the color to <a> Selected Text is mapped to highlightText & highlight Button Text is mapped to buttonFace Background is mapped to window
  • 51. Are we with the times? 1.3.2 - Meaningful Sequence Level A When the sequence in which content is presented affects its meaning, a correct reading sequence can be programmatically determined.
  • 52. AKA, DOM order should match visual order Additional Info: https://www.w3.org/WAI/GL/WCAG20-TECHS/css.html#C27
  • 53. Can we? In the age of Flexbox and CSS Grid?
  • 54. Flexbox (unchanged order example) <div class="flex"> <div class="item-one"> ... </div> <div class="item-two"> ... </div> </div> .flex { display: flex; flex-direction: column; }
  • 55. Flexbox (changed order example) <div class="flex"> <div class="item-one"> ... </div> <div class="item-two"> ... </div> </div> .flex { display: flex; flex-direction: column; } .item-one { order: 1; }
  • 58. Ordering in the real world While this should be the case, and we should push for it ... in the real world, we need to see how practical this advice is. Source: https://www.w3.org/TR/css-flexbox-1/#order-accessibility
  • 59. Firefox’s Flexbox ‘bug’ Firefox used to have a ‘bug’, where if the visual order is changed with flexbox, the keyboard navigation followed the visual order instead of the DOM order. This turned out to be good, even though its technically a bug which violated the spec.
  • 60. Firefox’s Flexbox ‘bug’ (continued) It’s since been ‘fixed’ and now firefox’s behavior matches other browsers.
  • 61. How to fix problem of visual order not matching focus • This is a problem which needs fixing from the browsers as well as somewhere in the specs • I proposed an attribute which could specify how order should behave (by default matching DOM order, but can be changed to match visual) • Current debate whether we need a CSS fix for it or an HTML attribute for it. • Read more and comment on the WICG page for it.
  • 62. Thanks! • Shwetank Dixit • shwetank@barrierbreak.com • @shwetank
  • 63. Further Reading and resources • BarrierBreak CSS Accessibility Extension • Accessibility Developer Tools Chrome Extension • CSS Techniques for WCAG 2.0 • Google Web Fundamentals Tutorial on the CSS Paint API • JP de Vries article: Rems, ems and why you probably need them • Greg Whitworth’s article on how to use –ms-high-contrast • The webkit.org article on responsive design for motion • Leonie Watson on the Flexbox and Keyboard navigation disconnect. • Proposal for a new HTML attribute (or CSS entry) for allowing DOM order to follow visual order.