Skip to main content

Module style

Module style 

Source
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 blur field is parsed for forward compatibility but ignored. Honors border_radius for rounded shadows.
Color
An RGBA color.
CornerValues
Values for each corner (top-left, top-right, bottom-right, bottom-left).
EdgeValues
Values for each edge (top, right, bottom, left).
GradientStop
GridPlacement
Grid item placement.
LinearGradient
RadialGradient
ResolvedStyle
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§

AlignContent
AlignItems
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.
FlexDirection
FlexWrap
FontStyle
GridTrackSize
A single grid track size definition.
Hyphens
CSS hyphens property controlling word hyphenation.
JustifyContent
LineBreaking
Line breaking algorithm.
Overflow
Overflow behavior for container elements.
SizeConstraint
TextAlign
TextDecoration
TextOverflow
Text overflow behavior when text exceeds available width.
TextTransform