ddast-util-style
v0.2.0
Published
ddast utility that resolves a theme into ddast, fixing its appearance
Readme
ddast-util-style
A ddast → ddast utility that applies a theme to ddast, fixing its appearance.
import { styleDdast, DEFAULT_THEME, mergeTheme } from "ddast-util-style";
const styled = styleDdast(ddastRoot, mergeTheme(DEFAULT_THEME, { heading: { decorations: [] } }));Also usable as a unified Transformer (styleTransform).
Responsibilities
- Takes a theme and writes fixed, final appearance values onto ddast nodes (a heading's left bar vs. underline, whether a blockquote gets a bar, table zebra fills and borders, named style names, and so on).
- Finishes any structural decisions that only a theme can settle here (e.g. whether a
heading becomes a sidebar table or a headingWithRule) — never carries pdfmake-specific key
names or shapes (
ContentTable, etc.). It stays within ddast's own vocabulary; the actual transcription into pdfmake's shape isddast-util-to-pdfmake's job.
For the full boundary of responsibilities, see "styler.ts (ddast → ddast)" in ARCHITECTURE.md.
