Layouts
Flow and fixed layout in DocStudio: stack, row and grid, absolute positioning inside fixed regions, page size and margins, and header and footer regions.
Flow by default
Content flows from top to bottom and continues onto the next page when it does not fit. Three containers arrange children:
| Container | Behavior |
|---|---|
stack |
Children one below the other. gap and align (start, center, end, stretch) |
row |
Children side by side. gap, align and justify (start, center, end, between) |
grid |
Children fill cells left to right. columns is a list of tracks, gap sets spacing |
Grid tracks are a number (millimetres), auto, a percentage such as 30% or a fraction such as 1fr. A grid cannot span cells over several columns or rows. For tabular data use a table.
Fixed regions
Absolute positioning is allowed only inside a fixed region, which has a size in millimetres. Children carry a frame with x, y, optional w, h, rotate and z. A fixed region is never split across pages. Frames use the physical left and top, so a position means the same in left-to-right and right-to-left documents.
Set config.page.mode to fixed for a page that is entirely one fixed region, as in the certificate example.
Page
config.page sets size, orientation, margins, direction and background. page.header and page.footer each have a height and children, and repeat on every page.
Units
Margins, gaps, frames and track sizes are in millimetres. Font sizes are in points.
Styles
Styles are whitelisted: fontSize, fontWeight, fontStyle, fontFamily, color, background, textAlign, lineHeight, letterSpacing, padding, margin, border, opacity, direction, whiteSpace, overflowWrap and textDecoration. There is no free-form CSS.