Skip to content

Support path-length CSS property for SVG path elements #1363

@viralipurbey

Description

@viralipurbey

Expose the path-length CSS property for SVG path elements, promoting the existing pathLength presentation attribute to a CSS‑expressible path property as defined in SVG 2.

CSS values follow normal cascade and override the presentation attribute. No new web APIs or security surface are introduced; existing pathLength behavior is preserved.

Example

<svg width="200" height="60">
  <path id="p" d="M10 30 L190 30" pathLength="100" />
</svg>

<style>
  /* CSS overrides the presentation attribute */
  #p {
    path-length: 200;
    stroke: black;
    stroke-dasharray: 50 150;
  }
</style>

In this example, the path-length CSS property overrides the pathLength="100" attribute and participates in normal CSS cascading and animation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Unscreened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions