Skip to main content Link Search Menu Expand Document Toggle dark mode Copy Code (external link)
paperwork.help

Styles

The styles list holds CSS that is added to the document. Each one is a content item, and the name is optional.

"styles": [
  { "name": "base",  "type": "Content", "content": "body { font-family: Helvetica; font-size: 11pt; }" },
  { "name": "brand", "type": "Source",  "source": "https://example.com/brand.css" }
]

How they apply

Each style is added to the head of the main layout, in the order they are listed, so a later style can override an earlier one. Styles written in the layout itself apply as normal, along with the template’s own <link> stylesheets.

The CSS is the same language described in the CSS reference, including @page, @font-face and CSS variables.

Fonts and images

Fonts and images referred to from a style, with url(...), are loaded when the document is generated.

In code

The same styles are added to a builder with WithStyle, WithStyleFile and WithStyleUrl.