Accessibility Demo
- Recommended reading: Practical Web Accessibility (2nd edition) by Ashley Firth (accompanying source code).
- Responsive design, i.e. adapts to different screen sizes, namely mobile, tablet, desktop.
- Accessible names for all interactive elements.
- Able to navigate using Tab key (Shift-Tab for reverse order). Element receiving keyboard focus must have clear focus indication, e.g. change in border or outline.
- Buttons are for "doing", links are for "going". Links in text MUST be underlined as color-blind users may not see difference in color, even with hover effects.
- Aim for a Flesch-Kincaid Readability test score of above 60 for content on website and in emails. As per the article Why Justified (or Centered) Text is Bad for Accessibility, do not use justified text, and try not to use centered text if it spans more than 2 lines.
-
As much as possible, avoid setting the
idattribute on HTML elements as this creates global variables. E.g.:<input id="companyName" name="company" type="text">creates a global variablecompanyNameandconsole.log(companyName, window.companyName, window['companyName']);will return 3 references to the<input>element which when modified, modifies the element directly.
Alerts
Do not depend solely on color to differentiate the type of alert, prepend icon or status text (e.g. "Success: ", "Error: "). Try using the Sim Daltonism color blindness simulator to view the alerts below - the colors of the success and error messages will be indistinguishable.
Columns
3 columns on desktop, 2 columns on tablet, 1 column on mobile.
Forms
Nest inputs within <label> to create implicit association for
accessible names.
Tabs
Horizontal tabs on desktop/laptop, vertical accordion on mobile.
Tables
Hide columns from the right as viewport gets smaller, with content from hidden columns consolidated in a details icon.
| ID | Name | Username | Company Name | Role | Created | Actions |
|---|---|---|---|---|---|---|
| 1 | Alpha | alpha.admin | Acme Inc. | Organization Admin | 01 Jan 1900 |
|
| 2 | Beta | beta.finance | Wayne Enterprises | Finance User | 02 Feb 2020 |
|