Skip to content

Conversation

@jamesnw
Copy link
Collaborator

@jamesnw jamesnw commented Aug 15, 2024

No description provided.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Aug 15, 2024
@@ -0,0 +1,15 @@
name: SVG opacity
description: The SVG opacity properties and attributes control the transparency of parts of an SVG.
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Should propertyize the property name

  • "parts of an SVG" is a bit generic, especially as this feature has a few distinct aspects, eg global vs element scope, CSS vs SVG-specific

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In revisting this, I think the filter and gradient opacity belong in filter/gradient features, so I removed them here, and expanded the description. 39c1b73

- svg.global_attributes.flood-opacity
- svg.global_attributes.opacity
- svg.global_attributes.stroke-opacity
group: css
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have/need an svg group?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added in 39c1b73

@@ -0,0 +1,10 @@
name: SVG opacity
description: The SVG `opacity` properties and attributes control the transparency of a stroke, fill, or entire SVG element.
Copy link
Collaborator

Choose a reason for hiding this comment

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

In general, this feature seems to run in the opposite direction of paint-order https://github.com/web-platform-dx/web-features/pull/1696/files#r1749729649. What makes this an SVG thing versus a CSS thing (like paint-order)? Not saying you're wrong here, but I am trying to learn the boundaries of CSS and SVG.

More description-specific stuff:

  • If it's practical to do so (i.e., we're not talking about a dozen distinct names), name things in series rather than using wildcards. Sometimes we end up having to acknowledge a long list of things ("the Example API", "the example family of CSS properties", etc.) but if it's practical to include the actual characters developers would type, let's do it.
  • Prefer to put the most specific thing first (i.e., "the example CSS property" not "the CSS example property"), to aid skimming. Imagine them all in a list and you'll probably see the issue: everything ends up starting with the same-y "The SVG …" text.
Suggested change
description: The SVG `opacity` properties and attributes control the transparency of a stroke, fill, or entire SVG element.
description: The `opacity`, `fill-opacity`, and `stroke-opacity` SVG attributes control the transparency of a stroke, fill, or entire SVG element. The `fill-opacity` and `stroke-opacity` CSS properties correspond to the SVG attributes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What makes this an SVG thing versus a CSS thing (like paint-order)?

Here's an attempt at documenting this-

  • CSS properties that can be applied to HTML elements AND SVG elements (font-family, writing-mode) are generally grouped together.
  • CSS properties that can only be applied to SVG elements (stop-color, vector-effect) are generally a separate feature.

Some CSS properties for SVG elements also have analogous attributes, but this is orthogonal. The attributes should be follow the same rules, and be grouped with their related properties.

Given this, I'm moving svg.global_attributes.opacity to the opacity feature.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you! It's very helpful to hear how you're thinking through this stuff.

@jamesnw jamesnw requested a review from ddbeck September 10, 2024 13:43
@@ -0,0 +1,9 @@
name: SVG opacity
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's rename this file to opacity-svg.yml and change the title like so:

We don't have a lot of cases where this happens, but we kinda-sorta have a practice of using parentheses for disambiguation text. See #1492 for another example

Suggested change
name: SVG opacity
name: Opacity (SVG)

@jamesnw jamesnw requested a review from ddbeck September 10, 2024 15:00
@ddbeck ddbeck merged commit e0d752a into web-platform-dx:main Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature definition Creating or defining new features or groups of features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants