Skip to content

Commit d32e5e9

Browse files
committed
separate into overview and shortcuts page, make more concise
1 parent 2c709a4 commit d32e5e9

File tree

4 files changed

+101
-106
lines changed

4 files changed

+101
-106
lines changed

fern/products/docs/docs.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ 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
1412
- link: Customer showcase
1513
href: https://buildwithfern.com/showcase#docs-customers.alldocs-features
1614
- changelog: ./pages/changelog
@@ -164,6 +162,13 @@ navigation:
164162
path: ./pages/customization/user-feedback.mdx
165163
- page: Custom CSS & JS
166164
path: ./pages/component-library/custom-components/custom-css-js.mdx
165+
- section: Accessibility
166+
collapsed: true
167+
contents:
168+
- page: Overview
169+
path: ./pages/accessibility/overview.mdx
170+
- page: Keyboard shortcuts
171+
path: ./pages/accessibility/keyboard-shortcuts.mdx
167172
- section: API references
168173
collapsed: true
169174
contents:
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: "Keyboard shortcuts"
3+
description: "Learn about keyboard shortcuts in Fern documentation, including navigation shortcuts, search commands, Ask AI panel controls, and API playground shortcuts."
4+
---
5+
6+
Fern docs include built-in keyboard shortcuts for navigation, search, and interactive features.
7+
8+
## Interactive elements
9+
10+
| Action | Shortcut |
11+
|--------|----------|
12+
| Move focus between interactive elements | `Tab` |
13+
| Move focus backward between interactive elements | `Shift` + `Tab` |
14+
| Activate [buttons](/learn/docs/writing-content/components/button) and [expandable sections](/learn/docs/writing-content/components/accordions) | `Enter` or `Space` |
15+
| Close open dialogs, panels, and the API playground | `Escape` |
16+
| Toggle Ask AI panel | `Command` + `/` (macOS)<br/>`Ctrl` + `/` (Windows/Linux) |
17+
| Toggle API playground/explorer | `Ctrl` + `` ` `` |
18+
19+
<Note>
20+
The `Command`/`Ctrl` + `/` shortcut is different from the single `/` key which opens the regular [search dialog](#search).
21+
</Note>
22+
23+
## Navigation
24+
25+
| Action | Shortcut |
26+
|--------|----------|
27+
| Navigate to the previous or next page | `Command` + `← / →` (macOS)<br/>`Alt` + `← / →` (Windows/Linux) |
28+
| Scroll to top or bottom of page | `Command` + `↑ / ↓` (macOS)<br/>`Ctrl` + `↑ / ↓` (Windows/Linux) |
29+
30+
<Note>
31+
Some browsers may intercept these shortcuts for back/forward history navigation.
32+
</Note>
33+
34+
## Search
35+
36+
| Action | Shortcut |
37+
|--------|----------|
38+
| Open search dialog | `Command` + `K` (macOS)<br/>`Ctrl` + `K` (Windows/Linux) |
39+
| Open search dialog when focus isn't in a text input field | `/` (forward slash) |
40+
41+
<Note>
42+
The `/` shortcut won't work when typing in an input field, `textarea`, or `contenteditable` element.
43+
</Note>
44+
45+
Within the search dialog:
46+
47+
| Action | Shortcut |
48+
|--------|----------|
49+
| Navigate between search results | `Arrow keys` |
50+
| Select a search result | `Enter` |
51+
52+
## Troubleshooting
53+
54+
If keyboard shortcuts aren't working:
55+
56+
- **Browser conflicts**: Some browsers use the same shortcuts for their own features (e.g., `Command` + `← / →` for history navigation).
57+
- **Operating system conflicts**: Your OS may intercept certain keyboard combinations. Check your system keyboard settings.
58+
- **Focus in input fields**: The `/` shortcut won't work when typing in a text field. Use `Command`/`Ctrl` + `K` instead.
59+
- **Extension conflicts**: Browser extensions may override keyboard shortcuts. Try disabling extensions.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: "Overview"
3+
description: "Discover the accessibility features in Fern documentation, including keyboard navigation, Web Content Accessibility Guidelines (WCAG) 2.1 AA color contrast enforcement, and screen reader support."
4+
---
5+
6+
Fern docs use semantic HTML and ARIA attributes to support screen readers and keyboard navigation.
7+
8+
<Note title="Feedback">
9+
Reach out to [email protected] to report accessibility issues or suggest improvements.
10+
</Note>
11+
12+
## Keyboard navigation
13+
14+
All interactive elements support keyboard navigation using `Tab`, `Enter`, and `Space` keys. See [keyboard shortcuts](/learn/docs/accessibility/keyboard-shortcuts#interactive-elements) for the complete list.
15+
16+
## Dialogs and panels
17+
18+
Dialogs and panels in Fern docs are designed for [keyboard accessibility](/learn/docs/accessibility/keyboard-shortcuts#interactive-elements). Focus is trapped within open dialogs to prevent navigation outside the dialog, and the search dialog supports full keyboard navigation with arrow keys.
19+
20+
## Color contrast
21+
22+
Fern automatically enforces [WCAG 2.1 AA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum) color contrast ratios to ensure text and interactive elements are readable for all users:
23+
24+
- **Normal text**: 4.5:1 minimum ([WCAG AA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-minimum))
25+
- **UI elements**: 3:1 minimum
26+
- **Enhanced**: 7:1 when feasible ([WCAG AAA](https://www.w3.org/WAI/WCAG21/quickref/#contrast-enhanced))
27+
28+
When you [configure colors in your `docs.yml` file](/learn/docs/configuration/what-is-docs-yml#colors-configuration), Fern validates accent colors. If your accent color doesn't meet the minimum contrast ratio against your background color, Fern will:
29+
30+
1. Display a warning during `fern check` validation
31+
2. Automatically adjust the accent color at runtime to meet WCAG AA standards
32+
3. Attempt to further adjust toward WCAG AAA (7:1) when possible
33+
34+
35+

fern/products/docs/pages/getting-started/accessibility.mdx

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)