<sk-progress-stroke-field>

← prev index next →

Ramps a value from the start of a stroke to its end — the field for gradients that run along a path, reveal-along-length effects, and progress bars.

Remarks

This is the along-the-length member of the StrokeField family: like every field it turns where into how much — a scalar weight consumers read by #id (field="#id") — but a stroke field is defined only along a stroke (see the general SpatialField concept for position-based fields). Here the weight is arc-length progress (strokeCoord.x): 0 at the stroke start, 1 at the end, rising linearly between — so a tonemap driven by it sweeps smoothly from one end of the path to the other.

Key attributes. clamp keeps the weight within [0, 1] through the end caps (on by default; turn it off to let cap regions read slightly past the ends). cap-progress-mode chooses whether progress is measured across the stroke body only or all the way to the cap tips. It needs no reference spline — it reads only the stroke coordinate.

Related. Sibling stroke fields: sk-dash-array-stroke-field (a repeating dash pattern) and sk-cross-stroke-field (fade across the width). For progress along a free-standing spline rather than a stroke, see sk-spline-progress-gradient-field. The usual consumer is a sk-tonemap applied through a sk-stroke-paint.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
id <id> The element's unique identifier — the standard HTML global id attribute.
remap-curveanimatable <remap-curve> Optional curve that reshapes this field's raw [0, 1] output.
remap-phaseanimatable <number> 0 Horizontal remap phase — an animatable scalar that translates a present
clampanimatable <boolean> Whether to clamp the output to [0, 1]. When false,
cap-progress-modeanimatable <cap-progress-mode> ("body-only" | "inclusive") How progress is computed relative to stroke caps.