Purpose of These DocsThese docs are meant as a starting point for using Anvil2 accessibly. While the contents can contribute to building accessible interfaces from scratch, that is not the main goal.
Overview
Directly Related WCAG Guidelines(s):- 1.3.1 Info and Relationships (Level A)
- 1.3.2 Meaningful Sequence (Level A)
- 2.4.6 Headings and Labels (Level AA)
- 4.1.2 Name, Role, Value (Level A)
| Anvil2 Responsibility | Implementor Responsibility |
|---|---|
| Anvil2 provides components with proper semantic tags and/or roles on them, along with the basic page layout. | Implementors ensure they are using the provided components correctly, while also making sure they are manually establishing correct logical flow and content separation of content. |
- Learn more about HTML semantics and the tags available to you.
- Learn more about accessibility roles that can be applied to elements when the actual tag can not be used.
Heading Hierarchy
Directly Related WCAG Guidelines(s):- 1.3.1 Info and Relationships (Level A)
- 2.4.6 Headings and Labels (Level AA)
- 2.4.10 Section Headings (Level AAA)
| Anvil2 Responsibility | Implementor Responsibility |
|---|---|
| Anvil provides components where text elements can be selected and handles page titles properly but not placement of the tags outside H1. | Implementors ensure they are not skipping heading levels when creating their pages. Layout of the page should reflect a table of contents with logical heading order. |
Best Practices
- Use only one <h1> per page as the main title
- Use <h2> for major sections, <h3> for subsections, and so on in sequential order
Common Pitfalls
- Skipping heading levels (e.g., jumping from <h2> to <h4>) creates confusion for assistive technologies and breaks the logical flow of your content structure
Sections, Articles, and Asides
Directly Related WCAG Guideline(s):- 1.3.1 Info and Relationships (Level A)
- 2.4.6 Headings and Labels (Level AA)
- 4.1.2 Name, Role, Value (Level A)
| Anvil2 Responsibility | Implementor Responsibility |
|---|---|
| Anvil2 provides you with main page content containers but not the containers needed for this foundation. | Implementors ensure that when creating content that they are using correct logical container elements in the right places. |
Best Practices
- Use <section> to group related content within a page
- Use <article> for self-contained, independently distributable content (like blog posts or news items)
- Use <aside> for content that’s tangentially related to the main content (like sidebars or pull quotes)
Common Pitfalls
- Using generic <div> elements instead of semantic tags—class names are not a substitute for proper semantics
- Misusing semantic tags for layout purposes, which can confuse assistive technologies about the flow of information
Text Style Variations
Directly Related WCAG Guidelines(s):- 1.3.1 Info and Relationships (Level A)
- 1.4.1 Use of Color (Level A)
- 1.4.3 Contrast (Minimum) (Level AA)
- 4.1.2 Name, Role, Value (Level A)
| Anvil2 Responsibility | Implementor Responsibility |
|---|---|
| Anvil2 provides a text component for consistent typography visuals but not styling utilities for style variations. | Implementors ensure they are using the correct html tags to denote their content within the text component. |
Best Practices
- Use <strong> when text is important or urgent—like warnings, required field indicators, or critical information
- Use <b> when you want to draw attention without conveying importance—like product names, keywords, or UI elements
- Use <em> when you want to emphasize or stress specific words or phrases to change the meaning
- Use <i> when text has a different voice or mood—like foreign words, technical terms, book titles, or thoughts
Common Pitfalls
- Using semantic tags for purely decorative purposes instead of conveying meaning
- Relying on visual styles alone instead of using appropriate semantic tags