Appearance
zeropdf / TemplateStylesheet
Interface: TemplateStylesheet
Defined in: src/types.ts:1896
Named styles applied to template blocks. Keys are either type selectors matching a block's type ("paragraph", "table", "link", "list", "image", plus per-format image types like "png", and per-level headings "heading"/"heading1".."heading6") or arbitrary class names referenced by a block's class field.
Resolution cascade for each block (low to high priority): page defaults → matching type selectors (generic before specific) → each class in class order → the block's inline options. Merging is shallow.
Example
ts
styles: {
paragraph: { fontSize: 11, lineHeight: 16 },
heading1: { fontSize: 24, color: rgb(0.1, 0.2, 0.5) },
callout: { color: rgb(0.8, 0, 0), marginTop: 12 },
}Indexable
ts
[selector: string]: TemplateStyle | undefined