Codespan Category Keys
codespan
The keys in the codespan
category are used for inline monospace text in prose and table cells.
Key | Value Type | Example |
---|---|---|
background-color |
Color |
|
Color |
|
|
Number |
|
|
border-radius |
Measurement |
|
border-width |
Measurement |
|
font-color |
Color |
|
font-family |
Font family name |
|
Number |
|
|
font-style |
Font style |
|
border-color
A border is only drawn around a code phrase if the border-color
key is specified and the border-width
key isn’t explicitly set to zero.
The border only works properly if the code phrase doesn’t have nested formatting.
Otherwise, the border will be inherited, producing a less than desirable result.
border-offset
The border offset is the amount that the background and border swells around the text. It does not affect the distance between the formatted phrase and the phrases that surround it.
font-size
You’re strongly encouraged to set the value of the font-size
key to a relative font size using the em
units (e.g., 0.9em
).
A code phrase with a fixed font size will not be scaled when the font size of the parent element (e.g., table, caption, etc.) is specified.
However, by using a relative value, the font size will be computed relative to the size of the text that surrounds it, giving you effectively the same result.