Re: [svgwg] stroke-width initial value must include units

> I’m not sure what you mean by “plain numbers are valid in CSS properties” but as far as the CSS stroke-width property specifically, unit-less numbers aren’t valid values…


In SVG 1 _and_ SVG 2, a unitless number is always allowed as a length in a presentation attribute (even for old CSS properties like `font-size`), [where it is processed into a `px` value](https://svgwg.org/svg2-draft/types.html#presentation-attribute-css-value).

SVG 1 _also_ always allowed a unitless number as a length ["for properties defined in SVG"](https://www.w3.org/TR/SVG11/types.html#DataTypeLength), extending the CSS definition. In SVG 2, we made these syntax options explicit for properties defined in SVG 1 (changing `<length>|<percentage>` to `<length-percentage>|<number>`), and resolved not to add the same behavior for new properties.

But `stroke-width` was defined and universally implemented in SVG 1, so it needs to have the full syntax that was valid in SVG 1, including `<number>`.


-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/529#issuecomment-414379589 using your GitHub account

Received on Monday, 20 August 2018 16:31:10 UTC