Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CSS SVG d and fill-* properties #754

Merged
merged 8 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions css/properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4621,6 +4621,22 @@
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cursor"
},
"d": {
"syntax": "none | path(<string>)",
"media": "visual",
"inherited": false,
"animationType": "basicShapeOtherwiseNo",
"percentages": "no",
"groups": [
"Scalable Vector Graphics"
],
"initial": "none",
"appliesto": "limitedSVGElementsPath",
"computed": "asSpecified",
"order": "perGrammar",
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/d"
},
"cx": {
"syntax": "<length> | <percentage>",
"media": "visual",
Expand Down Expand Up @@ -4733,6 +4749,54 @@
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/field-sizing"
},
"fill": {
"syntax": "none | <color> | <url> [none | <color>]? | context-fill | context-stroke",
"media": "visual",
"inherited": true,
"animationType": "byComputedValueType",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be listing:

the fill painting properties—fill-color, fill-image, fill-origin, fill-position, fill-size, and fill-repeat

Similar to https://github.com/mdn/data/pull/657/files?

Copy link
Member Author

@estelle estelle Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no.
` is defined as color and fallback, not background image.
https://svgwg.org/svg2-draft/painting.html#FillProperties is

origin, position, size, and repeat are not part of paint in any implementation

(this spec is from 2017 and seemingly abandoned. the above spec is the active one.)

"percentages": "no",
"groups": [
"Scalable Vector Graphics"
],
"initial": "black",
"appliesto": "limitedSVGElementsShapeText",
"computed": "asColorOrAbsoluteURL",
"order": "perGrammar",
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill"
},
"fill-opacity": {
"syntax": "<alpha-value>",
"media": "visual",
"inherited": false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this inherits: https://drafts.fxtf.org/fill-stroke-3/#fill-opacity or am I looking at the wrong place?

Copy link
Member Author

@estelle estelle Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.
but https://svgwg.org/svg2-draft/painting.html#FillOpacity is the better spec.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, gotcha, this is confusing with the SVG/CSS crossover

estelle marked this conversation as resolved.
Show resolved Hide resolved
"animationType": "byComputedValueType",
"percentages": "mapToRange0To1",
"groups": [
"Scalable Vector Graphics"
],
"initial": "1",
"appliesto": "limitedSVGElementsShapeText",
"computed": "specifiedValueNumberClipped0To1",
"order": "perGrammar",
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill-opacity"
},
"fill-rule": {
"syntax": "nonzero | evenodd",
"media": "visual",
"inherited": true,
"animationType": "discrete",
"percentages": "no",
"groups": [
"Scalable Vector Graphics"
],
"initial": "nonzero",
"appliesto": "limitedSVGElementsShapeText",
"computed": "asSpecified",
"order": "perGrammar",
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill-rule"
},
"filter": {
"syntax": "none | <filter-function-list>",
"media": "visual",
Expand Down
3 changes: 3 additions & 0 deletions css/properties.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"absoluteURIOrNone",
"angleRoundedToNextQuarter",
"asAutoOrColor",
"asColorOrAbsoluteURL",
"asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified",
"asLength",
"asSpecified",
Expand Down Expand Up @@ -247,7 +248,9 @@
"limitedSVGElementsGeometry",
"limitedSVGElementsGraphics",
"limitedSVGElementsGraphicsAndUse",
"limitedSVGElementsPath",
"limitedSVGElementsShapes",
"limitedSVGElementsShapeText",
"limitedSVGElementsTextContent",
"listItems",
"maskElements",
Expand Down
13 changes: 11 additions & 2 deletions l10n/css.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@
"de": "<code>auto</code> wird wie angegeben berechnet und <code>&lt;color&gt;</code> Werte werden wie für die {{cssxref(\"color\")}} Eigenschaft berechnet.",
"ja": "<code>auto</code> は仕様通りに計算され、 <code>&lt;color&gt;</code> 値は {{cssxref(\"color\")}} プロパティで定義されたように計算される。"
},
"asColorOrAbsoluteURL": {
"en-US": "as specified, but with <code>&lt;color&gt;</code> values computed and <code>&lt;url&gt;</code> values made absolute"
},
"asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified": {
"de": "wie definiert für {{cssxref(\"basic-shape\")}} (gefolgt von {{cssxref(\"shape-box\")}}, falls angegeben), dem {{cssxref(\"image\")}}, dessen URI absolut gemacht wurde, ansonsten wie angegeben.",
"en-US": "as defined for {{cssxref(\"basic-shape\")}} (with {{cssxref(\"shape-box\")}} following, if supplied), the {{cssxref(\"image\")}} with its URI made absolute, otherwise as specified.",
Expand Down Expand Up @@ -968,11 +971,17 @@
"limitedSVGElementsEllipse": {
"en-US": "{{SVGElement(\"ellipse\")}} and {{SVGElement(\"circle\")}} elements in {{SVGElement(\"svg\")}}"
},
"limitedSVGElementsEllipseRect": {
"en-US": "{{SVGElement(\"ellipse\")}} and {{SVGElement(\"rect\")}} elements in {{SVGElement(\"svg\")}}"
},
"limitedSVGElementsGeometry": {
"en-US": "{{SVGElement(\"svg\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"image\")}}, and {{SVGElement(\"foreignObject\")}} elements in an <code>svg</code>"
},
"limitedSVGElementsEllipseRect": {
"en-US": "{{SVGElement(\"ellipse\")}} and {{SVGElement(\"rect\")}} elements in {{SVGElement(\"svg\")}}"
"limitedSVGElementsPath": {
"en-US": "{{SVGElement(\"path\")}} element in {{SVGElement(\"svg\")}}"
},
"limitedSVGElementsShapeText": {
"en-US": "SVG shapes and text content elements"
},
"limitedSVGElementsFilterPrimitives": {
"en-US": "The set of elements that control the output of a {{SVGElement(\"filter\")}} element in {{SVGElement(\"svg\")}}"
Expand Down
Loading