webref icon indicating copy to clipboard operation
webref copied to clipboard

Use definition of CSS `<paint>` from SVG 2 instead of CSS Fill Stroke

Open cdoublev opened this issue 2 years ago • 2 comments

Thanks to this patch, the value definition of the fill property is picked from SVG 2 instead of CSS Fill Stroke. The reasons for this are explained in https://github.com/w3c/webref/issues/127#issuecomment-1135841726.

This value definition is <paint>. In SVG 2, <paint> is defined with none | <color> | .... But the definition from CSS Fill Stroke is selected during the curation and is none | <image> | <svg-paint>: none of these types allows to successfully parse black (matching <color>), which is the initial fill value defined in SVG 2.

EDIT: note that the definition of <paint> from SVG 2 is annotated in prose... (sorry).

cdoublev avatar Jun 15 '22 09:06 cdoublev

I think we're going to need to somehow rename one of the <paint> definitions, e.g. the one in SVG 2 to something like <svg-fillstroke-paint> or the one CSS Fill Stroke to <fill-stroke-paint>.

That is needed because we both have properties that need to reference the SVG version (fill and stroke, at least for now) and properties that need to reference the definition in Fill Stroke (fill-image and stroke-image).

If we update the definition in SVG 2, we will also need to update the <paint> reference in SVG Strokes.

tidoust avatar Jun 16 '22 14:06 tidoust

I had not seen its use in other property definitions from CSS Fill Stroke.

I wonder if you would not better off revert picking fill and stoke from SVG. I will stick to SVG definitions, which are supported in all browsers, and ignore those of CSS Fill Stroke, whose differences with SVG are not supported in any browser, but browser support is a subjective goal and I understand yours (future-proof, maintanability, etc.). If I were using @webref/css for a CSS documation application (eg. CSSTree syntax reference), renaming <paint> to an unspecified name would be a problem.

cdoublev avatar Jun 17 '22 04:06 cdoublev