Skip to content

Latest commit

 

History

History
93 lines (86 loc) · 5.53 KB

Writing_Even_More_CSS_With_Accessibility_In_Mind.md

File metadata and controls

93 lines (86 loc) · 5.53 KB

Writing Even More CSS With Accessibility In Mind

Speaker: Manuel Matuzović
Twitter: @mmatuzo
Slides: https://noti.st/matuzo/lWUq2w/writing-even-more-css-with-accessibility-in-mind

Progressive Enhancement

  • Instead of loading thousands of lines of code, use less JS & CSS
  • Only us JS if you really need it
  • Layers
    • HTML
    • CSS
    • JS
  • CSS has error handling in itself
  • This color will work fine in any browser, the error is skipped
div {
    color: #FFF;
    css-is: amazing;
    background: #000;
}

Respecting User Preferences

Improving a{}y with CSS

  • explaining user interfaces
  • <a href="document.pdf" download>download file</a>
  • a[download]::after { background-image: url('icons/download.png')}
  • Tips on Making Sure Hidden Content is Accessible (or Not!) https://scottvinkle.me/blogs/blog/hidden-content
  • Use aria-describedby to enhance user message

Testing a11y

  • a11y-tests.css file https://github.com/matuzo/a11y-tests.css
  • Test a website without a mouse
  • remove all colours a11y-tests-grayscale
.a11y-tests-grayscale {
    filter: grayscale(100%) !important
}

<html class="a11y-test-grayscale lang="en">
...
</html>
html:not([lang]),
html[lang=" "],
html[lang=""],
html:not(:lang(en)) {
    border: 10px solid red;
}
  • About the lang attribute and translations: The lang attribute: browsers telling lies, telling sweet little lies https://www.matuzo.at/blog/lang-attribute/
  • Check for buttons
  • Check for links nested inside button

HTML Semantics

Resources