-
Notifications
You must be signed in to change notification settings - Fork 199
Add SVG Opacity #1604
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
Add SVG Opacity #1604
Conversation
features/svg-opacity.yml
Outdated
| @@ -0,0 +1,15 @@ | |||
| name: SVG opacity | |||
| description: The SVG opacity properties and attributes control the transparency of parts of an SVG. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Should
propertyizethe 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
There was a problem hiding this comment.
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
features/svg-opacity.yml
Outdated
| - svg.global_attributes.flood-opacity | ||
| - svg.global_attributes.opacity | ||
| - svg.global_attributes.stroke-opacity | ||
| group: css |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 39c1b73
features/svg-opacity.yml
Outdated
| @@ -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. | |||
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
features/svg-opacity.yml
Outdated
| @@ -0,0 +1,9 @@ | |||
| name: SVG opacity | |||
There was a problem hiding this comment.
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
| name: SVG opacity | |
| name: Opacity (SVG) |
No description provided.