Skip to content

Commit 139ac57

Browse files
authored
Add keyboard shortcut advice to the Style Guide (#23095)
1 parent 9049fd7 commit 139ac57

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

contributing/content-style-guide.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,60 @@ More resources for learning about inclusive and accessible language and style:
170170
- [Readability Guidelines](https://readabilityguidelines.co.uk/)
171171
- [Conscious Style Guide](https://consciousstyleguide.com/)
172172

173+
## Keyboard shortcuts
174+
175+
For presenting keyboard shortcuts, follow the [Microsoft Style Guide](https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/keys-keyboard-shortcuts), **except for the following differences**:
176+
177+
- Use the HTML `<kbd>` tag for each individual key.
178+
179+
- **Use:** `<kbd>Command</kbd>+<kbd>B</kbd>`
180+
- **Avoid:** `Command+B`
181+
- Use full words instead of symbols for Apple modifier keys.
182+
183+
- **Use:** `Command`
184+
- **Avoid:** ``
185+
- Use symbols for keys of special character, not full words.
186+
187+
- **Use:** `.`, `,`, and ``.
188+
- **Avoid:** `Period`, `Comma`, and `Right arrow`.
189+
190+
### Usage highlights
191+
192+
Below are some usage highlights for how we present keyboard shortcuts in our documentation:
193+
194+
- The basic syntax is to show keys with `+` between key combinations, without any spaces.
195+
196+
- **Use:** `<kbd>Command</kbd>+<kbd>B</kbd>`, which is rendered as <kbd>Command</kbd>+<kbd>B</kbd>.
197+
- **Avoid:** `<kbd>Command</kbd> + <kbd>B</kbd>` or `<kbd>Command + B</kbd>` which are rendered as <kbd>Command</kbd> + <kbd>B</kbd> or <kbd>Command + B</kbd>.
198+
- Always capitalize letter keys for general references and keyboard shortcuts.
199+
200+
- **Use:** <kbd>Command</kbd>+<kbd>B</kbd>
201+
- **Avoid:** <kbd>Command</kbd>+<kbd>b</kbd>.
202+
- Use the correct modifier keys for the each operating system.
203+
204+
**Note:** Windows and Linux have <kbd>Ctrl</kbd> abbreviated, whereas on Mac it is spelled in full: <kbd>Control</kbd>.
205+
206+
- For Windows and Linux:
207+
208+
- **Use:** <kbd>Ctrl</kbd>, <kbd>Alt</kbd>.
209+
- **Avoid:** <kbd>Control</kbd>
210+
- For Mac:
211+
212+
- **Use:** <kbd>Command</kbd>, <kbd>Option</kbd>, <kbd>Control</kbd>.
213+
- **Avoid:** <kbd>Cmd</kbd>, <kbd>⌘</kbd>, <kbd>Opt</kbd>, <kbd>⌥</kbd>, <kbd>Ctrl</kbd>, <kbd>⌃</kbd>
214+
- Don't confuse key combinations with keys in a sequence.
215+
216+
- <kbd>Command</kbd>+<kbd>B</kbd> indicates that the user should hold down the <kbd>Command</kbd> key and press the <kbd>B</kbd> key.
217+
- <kbd>G</kbd> <kbd>I</kbd> indicates that the user should press the <kbd>G</kbd> key, then press the <kbd>I</kbd> key.
218+
- When describing a keyboard shortcut for multiple operating systems, append the operating system in brackets after the shortcut. Describe the Mac shortcut first, then Windows/Linux.
219+
220+
- **Use:** `<kbd>Command</kbd>+<kbd>B</kbd> (Mac) or <kbd>Ctrl</kbd>+<kbd>B</kbd> (Windows/Linux)`, presented as:
221+
222+
<kbd>Command</kbd>+<kbd>B</kbd> (Mac) or <kbd>Ctrl</kbd>+<kbd>B</kbd> (Windows / Linux)
223+
- **Avoid:** `<kbd>Ctrl</kbd>+<kbd>B</kbd> or <kbd>Command</kbd>+<kbd>B</kbd>`, presented as:
224+
225+
<kbd>Ctrl</kbd>+<kbd>B</kbd> or <kbd>Command</kbd>+<kbd>B</kbd>
226+
173227
## Linebreaks
174228

175229
For plain text, use linebreaks to separate paragraphs in the source (two consecutive linebreaks), rather than to create visual space in the source. Avoid unneeded linebreaks, especially in lists.

0 commit comments

Comments
 (0)