Skip to content

[css-values] Add pl unit for SVG path length #221

@tabatkins

Description

@tabatkins

SVG defined percentages in the dashing properties to be relative to the scaled viewport size (which is useless in most cases), but there are good use-cases for doing dashes relative to the path length, too. In particular, the common "make it look like it's drawing itself" hack needs that; right now you have to guess about path length or use JS to calculate and set it manually.

Since we can't change percentages now, and doing a mode-switch to change the meaning of percentages dynamically is a bit of an anti-pattern, the better solution is to introduce a new unit for path length. Similar to the other "percent-like" viewport units, a path should be 100pl long.

Thoughts on naming?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions