normalizeEdges
import { normalizeEdges } from "@pibbl/core";normalizeEdges(value, property, context?) converts an EdgeValues shorthand
into Edges. A number applies to all four edges; omitted values become zero.
Every edge must be finite and nonnegative, otherwise a LayoutDiagnostic
identifies the source property and context.
const padding = normalizeEdges({ top: 8, left: 12 }, "padding");The accepted types are documented under Layout and styles.
API details from source
Section titled “API details from source”
Expands shorthand insets into four validated numeric edges.
normalizeEdges: (value: EdgeValues | undefined, property: string, context?: Readonly<LayoutDiagnosticContext>) => EdgesRelated API: normalizeEdges, EdgeValues, LayoutDiagnosticContext, Edges.
Parameters
Section titled “Parameters”-
value— Edge shorthand to expand; undefined uses the empty edge defaults. See EdgeValues . -
property— Property name used in diagnostics. -
context— Component and property context for diagnostic messages. See LayoutDiagnosticContext .
Returns
Section titled “Returns”Explicit top, right, bottom, and left edge values. See Edges.
See also
Section titled “See also”View source — packages/core/src/lib/style/normalize.ts:22
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Authoring, signals, and lifecycle companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Box resolution: Resolve padding, percentages, and a constrained box with typed diagnostics. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.