Caption Category Keys

The keys in the caption category control the arrangement and style of block captions globally. Many of these keys can be customized per block.

caption

The caption-align and caption-text-align keys on the image and table categories also accept the value inherit. See Block Image Styles and Table Styles for more information about setting inherit on their captions.
Key Value Type Example

align

Block alignment
(default: left)

caption:
  align: right
yaml

background-color

Color
(default: not set)

caption:
  background-color: #DDDDDD
yaml

end

top | bottom
(default: varies by block)

caption:
  end: bottom
yaml

font-color

Color
(default: inherit)

caption:
  font-color: #333333
yaml

font-family

Font family name
(default: inherit)

caption:
  font-family: M+ 1mn
yaml

font-kerning

none | normal
(default: inherit)

caption:
  font-kerning: none
yaml

font-size

Font size
(default: inherit)

caption:
  font-size: 11
yaml

font-style

Font style
(default: italic)

caption:
  font-style: italic
yaml

margin-inside

Measurement
(default: 4)

caption:
  margin-inside: 3
yaml

margin-outside

Measurement
(default: 0)

caption:
  margin-outside: 0
yaml

text-align

Text alignment
(default: $<category>-caption-align or $caption-align)

caption:
  text-align: right
yaml

text-decoration

Text decoration
(default: none)

caption:
  text-decoration: line-through
yaml

text-decoration-color

Color
(default: $caption-font-color)

caption:
  text-decoration-color: #FF0000
yaml

text-decoration-width

Number
(default: $base-text-decoration-width)

caption:
  text-decoration-width: 0.5
yaml

text-transform

Text transform
(default: inherit)

caption:
  text-transform: uppercase
yaml

Caption per block

In addition to the global caption category, each of the keys listed in caption, except for the text-decoration keys, can be set on the caption key nested inside the following block categories:

  • code

  • example

  • footnotes

  • image

  • quote

  • table

  • verse

For example, to configure the caption just for code blocks, use the following declaration:

code:
  caption:
    background-color: #FF0000
    font-color: #FFFFFF
    font-size: 1em
    font-style: bold
yaml

If a key is not specified on a block category, the key from the global caption category will be used as a fallback.