Skip to content

Custom Document CSS

StrawBlond allows developers to futher customize the invoice and offer document template with CSS (and paged media).

Take a look at the typeset.sh documentation (our PDF rendering engine) for highly custom design requirements.

Custom Properties

Our template defines a few CSS variables (custom properties) to allow easy modification of base styles.

css
:root {
    --font-size-sm: 6.4pt;
    --font-size-base: 8pt;
    --font-size-lg: 10pt;
    --font-size-xl: 12.8pt;

    --font-weight-normal: 400;
    --font-weight-bold: 600;

    --letter-spacing: normal;

    --theme-primary: rgb(0 0 0);
    --heading-color: rgb(0 0 0);
    --font-color: rgb(0 0 0);
    --muted-color: rgb(0 0 0 / 0.5);

    --border-color: rgb(0 0 0);
    --border-color-opaque: rgb(0 0 0 / 0.25);
}

CSS Classes

ClassDescription
documentThe full document wrapper, but without header/footer/logo
document-page-counterThe page counter wrapper
document-info-tableThe info table containing properties like due date, issue date
document-topThe full top part of the document (address and info table)
document-addressThe address block wrapper
address-senderThe sender address line
address-recipientThe recipient address block
document-numberThe document number heading (eg. "RE-4242")
document-titleThe main title heading
document-headerThe documents header text
document-footerThe documents footer text
document-summaryThe document summary (totals, subtotals of sections)
page-labelThe page counter label (eg. "Seite")
page-countThe page counter value (eg. "1/2")
line-itemThe line item row
line-item-titleThe line item title
line-item-descriptionThe line item description
line-item-groupThe wrapper around line item groups
line-item-group-titleThe line item group title

Custom Fonts

Implement your custom fonts via @font-face the same way you would on your website. Our rendering engine supports OTF, TTF and WOFF files (WOFF is recommended).

Page Counter

Our rendering engine defines two special CSS Counters, page and pages, which can be used to display the current page number and the total number of pages, respectively.

The initial CSS looks like this:

css
.page-count {
    content: counter(page) "/" counter(pages);
}