Expand description
§Style System
A CSS-like style model for document nodes. This is intentionally a subset of CSS that covers the properties needed for document layout: flexbox, box model, typography, color, borders.
We don’t try to implement all of CSS. We implement the parts that matter for PDF documents, and we implement them correctly.
Structs§
- BoxShadow
- CSS-style drop shadow. v1 paints a filled rectangle offset behind the
element with the given color; the
blurfield is parsed for forward compatibility but ignored. Honorsborder_radiusfor rounded shadows. - Color
- An RGBA color.
- Corner
Values - Values for each corner (top-left, top-right, bottom-right, bottom-left).
- Edge
Values - Values for each edge (top, right, bottom, left).
- Gradient
Stop - Grid
Placement - Grid item placement.
- Linear
Gradient - Radial
Gradient - Resolved
Style - Resolved style: all values are concrete (no Option, no Auto for computed values). This is what the layout engine works with after style resolution.
- Style
- The complete set of style properties for a node.
Enums§
- Align
Content - Align
Items - Background
- CSS-style background that may be a solid color or a gradient. The
React layer parses CSS strings (
linear-gradient(180deg, #fff, #000),radial-gradient(circle, #fff, #000),#abcdef) into this shape. - Dimension
- A dimension that can be points, percentage, or auto.
- Direction
- Text direction for BiDi support.
- Display
- Layout display mode.
- Flex
Direction - Flex
Wrap - Font
Style - Grid
Track Size - A single grid track size definition.
- Hyphens
- CSS
hyphensproperty controlling word hyphenation. - Justify
Content - Line
Breaking - Line breaking algorithm.
- Overflow
- Overflow behavior for container elements.
- Size
Constraint - Text
Align - Text
Decoration - Text
Overflow - Text overflow behavior when text exceeds available width.
- Text
Transform