Builds the styled tree: matches CSS rules against the DOM, resolves
the cascade (per property, ordered by origin + specificity + source
index), applies inheritance, and resolves units to points — except
%, which stays symbolic ({:percent, n}) for Layout to resolve
against the actual containing block width it computes. See
docs/superpowers/specs/2026-07-24-css-parser-cascade-design.md for
the full algorithm.
Summary
Functions
Builds a styled node tree by applying the CSS cascade to the DOM.
Resolves the final page configuration (size and margin) from @page rules.
Functions
@spec build([Press.HTML.Element.t() | Press.HTML.Text.t()], [Press.CSS.Rule.t()], [ Press.CSS.Rule.t() ]) :: [Press.Style.Node.t() | Press.Style.Text.t()]
Builds a styled node tree by applying the CSS cascade to the DOM.
@spec page_config([Press.CSS.PageRule.t()], [Press.CSS.PageRule.t()]) :: %{ size: {float(), float()}, margin: %{top: float(), right: float(), bottom: float(), left: float()} }
Resolves the final page configuration (size and margin) from @page rules.