Code
Code shows short pieces of code inline with body text.
When to use
- A value that must be typed or copied exactly, such as a token name, a flag or a path.
- Inline, for a single identifier inside a sentence.
- As a block, for code people will copy in full.
When not to use
- Emphasis. Code styling tells people to type something exactly, so do not use it on ordinary words.
- A product or feature name. Write it as normal text.
- A long listing with no explanation. People need to know what the code is for.
Guidance
Do
Set
--wr-surface to change the page background.Use inline code only for the exact value to type. Leave the rest of the sentence as normal text.
Don't
Set
the surface colour to change the page background.Do not put ordinary words in code. It suggests they are something to type.
Intensity
How much attention each of this component's grounds uses, scored against the ladder in both themes.
| Appearance | Ground | Light | Dark |
|---|---|---|---|
| code | neutral | 0.042Ambient | 0.066Substrate |
Substrate, Ambient and Marked are measured. Directed depends on what else is in the region. Demanded is declared, and its use is limited. So neither of those two depends on the component alone. See intensity.
Content
What to write, and what to leave out.
- Write the value exactly, including its punctuation and case.
- Keep a block to what people need. Long listings tend to get skipped.
- Say what a block does before you show it.