WCAG, semantics, keyboard, ARIA, testing
Practise these as flashcards. One or two lines each; the ones you miss come back first.
Start freeWCAG stands for Web Content Accessibility Guidelines. It's important because it provides a framework to ensure web content is accessible to people with disabilities, covering visual, auditory, motor, and cognitive needs.
The four principles are Perceivable (content must be presented in ways users can perceive), Operable (users must be able to interact with content), Understandable (content and operation must be clear), and Robust (content must work with current and future technologies).
Semantic HTML elements are natively understood by browsers and assistive technologies, providing accessibility out of the box. ARIA should only be used when semantics can't achieve the desired accessibility, as improper use can cause confusion.
You can tab through the site using only the keyboard, ensuring all interactive elements are reachable and usable, and that focus indicators are visible.
WCAG AA requires a minimum contrast ratio of 4.5:1 for normal text between foreground and background colors.
When a modal opens, I move focus to the modal container using tabindex="-1" and .focus(). When it closes, I return focus to the element that triggered the modal, ensuring users don't lose their place.
prefers-reduced-motion media query?The prefers-reduced-motion media query allows you to detect if a user has requested reduced motion in their system settings, so you can minimize or disable animations and transitions to avoid causing discomfort.
I use screen readers like NVDA, JAWS, or VoiceOver, navigating through the site to check that content is read in the correct order, labels are clear, and ARIA attributes are functioning as intended.
Automated tools can catch many issues like missing alt text or insufficient contrast, but they can't assess things like logical focus order, meaningful labels, or overall usability. Manual testing is always necessary.
I use ARIA attributes for custom components, like adding role="dialog" and aria-modal="true" to a modal, or aria-live="polite" to a notification area, to provide extra context to assistive technologies.
I use semantic elements like <label> linked to inputs, provide clear instructions, validate input with accessible error messages, and test with screen readers to confirm labels and errors are announced correctly.
I structure the DOM to match the visual order, use semantic elements, and manage focus programmatically for dynamic content, ensuring users can navigate predictably with the keyboard.
aria-label and aria-labelledby?