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
(default: not set)

codespan:
  background-color: #F5F5F5

border-color

Color
(default: not set)

codespan:
  border-color: #CCCCCC

border-offset

Number
(default: 0)

codespan:
  border-offset: 2

border-radius

Measurement
(default: not set)

codespan:
  border-radius: 3

border-width

Measurement
(default: $base-border-width)

codespan:
  border-width: 0.5

font-color

Color
(default: inherit)

codespan:
  font-color: #B12146

font-family

Font family name
(default: Courier)

codespan:
  font-family: M+ 1mn

font-size

Number
(default: inherit)

codespan:
  font-size: 0.8em

font-style

Font style
(default: inherit)

codespan:
  font-style: bold

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.