Accessibility is a team effort. This guide helps developers collaborate effectively with designers and content authors to build accessible Rails applications.
Developers:
- Implement accessible HTML structure
- Ensure technical accessibility (ARIA, semantics)
- Run automated checks
- Fix violations
Designers:
- Design with accessibility in mind
- Ensure sufficient color contrast
- Design keyboard-friendly interactions
- Create accessible component patterns
Content Authors:
- Write descriptive alt text
- Create clear link text
- Structure content logically
- Write accessible form labels
Requirement: WCAG AA requires:
- Normal text: 4.5:1 contrast ratio
- Large text (18pt+ or 14pt+ bold): 3:1 contrast ratio
Tools:
- WebAIM Contrast Checker
- Stark - Figma/Sketch plugin
- Browser DevTools
Example:
✅ Good: #000000 on #FFFFFF (21:1)
✅ Good: #333333 on #FFFFFF (12.6:1)
❌ Bad: #CCCCCC on #FFFFFF (1.6:1)
Requirement: All interactive elements must have visible focus indicators.
Design:
- Clear, visible outline
- High contrast
- Consistent across components
Example:
button:focus {
outline: 3px solid #0066cc;
outline-offset: 2px;
}Requirement: Minimum 44x44px touch targets (mobile).
Design:
- Buttons large enough to tap easily
- Adequate spacing between interactive elements
- Consider thumb zones on mobile
Requirement: Text must be resizable up to 200% without loss of functionality.
Design:
- Use relative units (em, rem, %)
- Avoid fixed pixel sizes for text
- Test at 200% zoom
/* Primary button */
.btn-primary {
background: #0066cc;
color: #ffffff;
padding: 12px 24px;
min-height: 44px; /* Touch target */
border: 2px solid transparent;
}
.btn-primary:focus {
outline: 3px solid #0066cc;
outline-offset: 2px;
}
.btn-primary:hover {
background: #0052a3;
}.form-label {
display: block;
margin-bottom: 8px;
font-weight: 600;
}
.form-input {
padding: 12px;
border: 2px solid #ccc;
border-radius: 4px;
}
.form-input:focus {
outline: 3px solid #0066cc;
outline-offset: 2px;
border-color: #0066cc;
}
.form-error {
color: #d32f2f;
margin-top: 4px;
font-size: 0.875rem;
}When handing off designs, include:
- Color specifications - Hex codes with contrast ratios
- Focus states - How focus should look
- Error states - How errors are displayed
- Loading states - How loading is indicated
- Keyboard interactions - Tab order, keyboard shortcuts
- All text meets contrast requirements
- Focus states are visible and clear
- Touch targets are at least 44x44px
- Color is not the only indicator (e.g., errors)
- Interactive elements are clearly identifiable
- Layout works at 200% zoom
Good:
Alt: "A red bicycle parked outside a coffee shop"
Alt: "Screenshot of the dashboard showing 5 active users"
Bad:
Alt: "Image" <!-- Too generic -->
Alt: "Photo" <!-- Not descriptive -->
Alt: "bicycle.jpg" <!-- Filename, not description -->
For purely decorative images, use empty alt:
<%= image_tag "border.png", alt: "" %>For charts, graphs, or infographics:
<%= image_tag "chart.png", alt: "Bar chart showing sales increased 25% from Q1 to Q2" %>Or provide a detailed description:
<figure>
<%= image_tag "chart.png", alt: "Sales chart" %>
<figcaption>Sales increased 25% from Q1 ($50k) to Q2 ($62.5k)</figcaption>
</figure><%= link_to "Read our privacy policy", privacy_path %>
<%= link_to "Download the user guide (PDF)", guide_path %><%= link_to "Click here", privacy_path %> <!-- Generic! -->
<%= link_to "More", article_path(@article) %> <!-- Vague! -->
<%= link_to "Read more", article_path(@article) %> <!-- Repeated! -->If link text is repeated, add context:
<article>
<h2><%= @article.title %></h2>
<p><%= @article.excerpt %></p>
<%= link_to "Read full article: #{@article.title}", article_path(@article) %>
</article><%= f.label :email, "Email Address" %>
<%= f.label :phone, "Phone Number (optional)" %>
<%= f.label :password, "Password (minimum 8 characters)" %><%= f.label :email, "Email" %> <!-- Could be clearer -->
<%= f.label :field1, "Field 1" %> <!-- Meaningless! --><h1>Page Title</h1>
<h2>Introduction</h2>
<h2>Features</h2>
<h3>Feature 1</h3>
<h3>Feature 2</h3>
<h2>Conclusion</h2><ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul><article>
<header>
<h1>Article Title</h1>
<p>By Author Name</p>
</header>
<main>
<!-- Content -->
</main>
<footer>
<p>Published on <%= @article.published_at %></p>
</footer>
</article>-
Designer provides:
- Design files with accessibility notes
- Color specifications with contrast ratios
- Component specifications
- Focus state designs
-
Developer reviews:
- Checks contrast ratios
- Verifies touch target sizes
- Confirms keyboard navigation
- Tests with screen reader
-
Feedback loop:
- Developer flags accessibility issues
- Designer adjusts as needed
- Iterate until accessible
-
Content author provides:
- Alt text for images
- Link text
- Form labels
- Heading structure
-
Developer reviews:
- Runs Rails A11y checks
- Verifies alt text quality
- Checks link text clarity
- Validates heading hierarchy
-
Feedback loop:
- Developer suggests improvements
- Content author revises
- Final review before publish
Schedule regular accessibility reviews:
- Design review - Check designs for accessibility
- Content review - Review alt text and copy
- Implementation review - Test with screen readers
- Final review - Full accessibility audit
- Figma: A11y - Focus Orderer
- Sketch: Stark
- Adobe XD: Built-in contrast checker
- Slack/Teams: Share accessibility reports
- GitHub: Comment on PRs with accessibility notes
- Notion/Confluence: Document accessibility patterns
- Browser DevTools: Built-in accessibility inspector
- axe DevTools: Browser extension
- WAVE: Web accessibility evaluation tool
Designer: "But it looks better this way!"
Solution: Show the contrast ratio. Explain that 1 in 12 men have color blindness. Offer alternative colors that meet contrast requirements.
Content Author: "But 'Click here' is clear in context!"
Solution: Explain that screen reader users navigate by links. Show how "Read privacy policy" is clearer than "Click here" out of context.
Content Author: "The image is decorative, why do I need alt text?"
Solution: Use empty alt (alt="") for decorative images. This tells screen readers to skip the image.
- Schedule a team meeting - Discuss accessibility goals
- Create style guide - Document accessibility patterns
- Set up reviews - Regular accessibility check-ins
- Share resources - Provide training materials
Remember: Accessibility is everyone's responsibility. Working together makes it easier and more effective.