Skip to main content

collapseTopMarginForChild

export
function collapseTopMarginForChild(
  n: number,
  tchildren: readonly Array<TNode>
) : number | null

Compute top collapsed margin for the nth ​TNode-child of a list of TNodes.

Parameters#

n#

required
n: number;

The index for which the top margin should be collapsed.

tchildren#

required
tchildren: readonly Array<TNode>;

The list of ​TNode children.

Returns#

null when no margin collapsing should apply, a number otherwise.