CKTIS / CSS
d — SVG path geometry in CSS
The CSS `d` property defines the geometry of an SVG `path` element. It lets the CSS cascade control the shape; `none` removes the path data from rendering without removing the element itself.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
d: none;
d: path("M 10 10 L 90 10 L 50 70 Z");d defines the geometry of an SVG path element, not its color or stroke width. Its initial value is none, and it is not inherited. With none, the path is neither rendered nor included in the bounding boxes of its ancestor containers.
Distinguish the SVG attribute d="M 10 10 L 90 10 L 50 70 Z" from the CSS declaration d: path("M 10 10 L 90 10 L 50 70 Z"). The attribute contains the data directly, whereas the CSS syntax used in browsers wraps it in path(). The supplied SVG 2 draft still describes the value as none | <string>—a documentation discrepancy, not a reason to copy attribute syntax directly into CSS. An ordinary author rule can override the d presentation attribute through the cascade.
Within path data, M moves the current point, L draws a line segment, and Z closes the subpath. Coordinates use SVG user units, without px or %. Uppercase commands generally use absolute coordinates and lowercase commands relative coordinates; Z and z have identical effects.
The example deliberately uses d: none to demonstrate overriding geometry supplied by an attribute: only the blue triangle should remain visible. This exact version of the example passed verification in an isolated environment. Before deployment, check it separately in the target Chromium 152 environment.
Examples
<!doctype html>
<meta charset="utf-8">
<title>CSS d</title>
<style>
#hidden { d: none; }
</style>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 80" width="240" height="160">
<path d="M 10 10 L 50 10 L 30 60 Z" fill="blue" />
<path id="hidden" d="M 70 10 L 110 10 L 90 60 Z" fill="red" />
</svg>Result
Only the blue triangle is visible; the red triangle is not rendered.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.