Skip to content

Commit 3d4109b

Browse files
docs: add accessibility and keyboard shortcuts documentation
- Add comprehensive accessibility documentation page under Getting Started - Document all keyboard shortcuts - Document WCAG 2.1 AA color contrast enforcement - Include troubleshooting section for common issues - Add page to Getting Started navigation in docs.yml Co-Authored-By: Chris McDonnell <[email protected]>
1 parent e24bbba commit 3d4109b

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

fern/products/docs/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ navigation:
99
path: ./pages/getting-started/quickstart.mdx
1010
- page: Project structure
1111
path: ./pages/getting-started/project-structure.mdx
12+
- page: Accessibility and keyboard shortcuts
13+
path: ./pages/getting-started/accessibility.mdx
1214
- link: Customer showcase
1315
href: https://buildwithfern.com/showcase#docs-customers.alldocs-features
1416
- changelog: ./pages/changelog
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: "Accessibility and keyboard shortcuts"
3+
subtitle: "Navigate and use Fern docs with keyboard shortcuts and accessibility features"
4+
description: "Learn about keyboard shortcuts and accessibility features in Fern documentation, including navigation shortcuts, search commands, and WCAG 2.1 AA color contrast enforcement."
5+
---
6+
7+
Fern docs are designed to be accessible and keyboard-friendly, supporting navigation and interaction without requiring a mouse. This page outlines the keyboard shortcuts and accessibility features available in Fern documentation.
8+
9+
## Keyboard shortcuts
10+
11+
### Page navigation
12+
13+
Navigate between previous and next pages in your documentation using keyboard shortcuts:
14+
15+
- **Command + ← / →** (macOS) or **Alt + ← / →** (Windows/Linux): Navigate to the previous or next page
16+
- Note: Some browsers may intercept these shortcuts for back/forward history navigation
17+
18+
### Search
19+
20+
Open the search dialog to quickly find content in your documentation:
21+
22+
- **Command + K** (macOS) or **Ctrl + K** (Windows/Linux): Open search dialog
23+
- **/** (forward slash): Open search dialog when focus is not in a text input field
24+
- Note: The `/` shortcut won't work when typing in an input field, textarea, or contenteditable element
25+
26+
Once the search dialog is open:
27+
- **Arrow keys**: Navigate between search results
28+
- **Enter**: Select a search result
29+
- **Escape**: Close the search dialog
30+
31+
### Ask AI panel
32+
33+
Toggle the Ask AI side panel for AI-powered search assistance:
34+
35+
- **Command + /** (macOS) or **Ctrl + /** (Windows/Linux): Toggle Ask AI panel
36+
- Note: This is different from the single `/` key which opens the regular search dialog
37+
38+
### API playground
39+
40+
Control the API playground/explorer when available:
41+
42+
- **Ctrl + `** (backtick): Toggle API playground/explorer
43+
- **Escape**: Close the API playground when it's open
44+
45+
### Browser shortcuts
46+
47+
Standard browser keyboard shortcuts also work in Fern docs:
48+
49+
- **Command + ↑ / ↓** (macOS) or **Ctrl + ↑ / ↓** (Windows/Linux): Scroll to top or bottom of page (browser-native behavior)
50+
51+
## Accessibility features
52+
53+
### Interactive elements
54+
55+
All interactive elements in Fern docs are keyboard accessible:
56+
57+
- **Enter** or **Space**: Activate buttons and expandable sections
58+
- **Tab**: Move focus between interactive elements
59+
- **Shift + Tab**: Move focus backward between interactive elements
60+
61+
### Dialogs and panels
62+
63+
Dialogs and panels in Fern docs are designed for keyboard accessibility:
64+
65+
- **Escape**: Close open dialogs, panels, and the API playground
66+
- Focus is trapped within open dialogs to prevent navigation outside the dialog
67+
- The search dialog supports full keyboard navigation with arrow keys
68+
69+
### Color contrast
70+
71+
Fern automatically enforces WCAG 2.1 AA color contrast ratios to ensure text and interactive elements are readable for all users, including those with visual impairments.
72+
73+
When you configure colors in your `docs.yml` file, Fern validates and adjusts accent colors to meet accessibility standards:
74+
75+
- **Minimum contrast ratio**: 4.5:1 (WCAG AA standard for normal text)
76+
- **Enhanced contrast ratio**: 7:1 (WCAG AAA standard when feasible)
77+
- **UI elements**: 3:1 minimum contrast ratio for graphics and user interface components
78+
79+
If your configured accent color doesn't meet the minimum contrast ratio against your background color, Fern will:
80+
81+
1. Display a warning during `fern check` validation
82+
2. Automatically adjust the accent color at runtime to meet WCAG AA standards
83+
3. Attempt to further adjust toward WCAG AAA (7:1) when possible
84+
85+
This ensures your documentation remains accessible regardless of your color choices, while still respecting your brand colors as closely as possible.
86+
87+
## Troubleshooting
88+
89+
### Keyboard shortcuts not working
90+
91+
If keyboard shortcuts aren't working as expected:
92+
93+
- **Browser conflicts**: Some browsers use the same shortcuts for their own features (e.g., Command + ← / → for history navigation). Try using the alternative shortcuts where available.
94+
- **Operating system conflicts**: Your OS may intercept certain keyboard combinations. Check your system keyboard settings if shortcuts aren't responding.
95+
- **Focus in input fields**: The `/` shortcut for search won't work when typing in a text field. Use **Command/Ctrl + K** instead, which works from anywhere.
96+
- **Extension conflicts**: Browser extensions may override keyboard shortcuts. Try disabling extensions if you experience issues.
97+
98+
### Screen reader support
99+
100+
Fern docs use semantic HTML and ARIA attributes to support screen readers. If you encounter accessibility issues with screen readers or other assistive technologies, please report them to the Fern team.
101+
102+
## Feedback
103+
104+
If you have suggestions for additional accessibility features or encounter any accessibility issues, please reach out to the Fern team through the [Slack community](https://buildwithfern.com/slack) or contact support.

0 commit comments

Comments
 (0)