Skip to content
New issue

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

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

Already on GitHub? # to your account

Add paint-order #1696

Merged
merged 5 commits into from
Sep 10, 2024
Merged

Add paint-order #1696

merged 5 commits into from
Sep 10, 2024

Conversation

jamesnw
Copy link
Collaborator

@jamesnw jamesnw commented Aug 28, 2024

Opened mdn/browser-compat-data#24367 to address Safari iOS support in svg.global_attributes.paint-order.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Aug 28, 2024
Copy link
Collaborator

@autonome autonome left a comment

Choose a reason for hiding this comment

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

Feels a quite small feature grouping, but if no other logical home for it, then looks good otherwise.

@jamesnw
Copy link
Collaborator Author

jamesnw commented Sep 6, 2024

Feels a quite small feature grouping, but if no other logical home for it, then looks good otherwise.

Good question, and thanks for the reminder to look at it through this lens. I'm not thinking of a logical grouping for this, but there could be one. There are articles an demos on just this feature that make it seem like a standalone feature. https://css-tricks.com/almanac/properties/p/paint-order/ https://nerdy.dev/css-paint-order

Comment on lines +6 to +7
- css.properties.paint-order
- svg.global_attributes.paint-order
Copy link
Collaborator

Choose a reason for hiding this comment

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

I probably ought to have asked for this previously, but there's no time like the present: are SVG attributes part of their corresponding CSS properties? I'm not sure that's quite right, but it's not wrong either. I think there's two ways to handle this:

  • Keep including SVG attrs, but also start assigning these things to an SVG group (maybe even an SVG-in-CSS group?).
  • Drop the SVG attributes, then consider SVG more holistically later on.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's pretty helpful for authors to associate the SVG and CSS versions of a feature like this. They really are the same feature - similar to JS API's being included along side CSS. But I expect in most cases SVG support will be significantly broader/farther back, since these generally start in SVG and then get adopted into CSS. Ideally, if they're not together, they are at least clearly associated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, cool. This works for me. I've had a bit of a look around and it does seem common for SVG and CSS to mentioned in the same setting—let's keep these together. If we want to group the SVG stuff, we can do that later.

@@ -0,0 +1,7 @@
name: paint-order
description: "The `paint-order` CSS property sets whether the `stroke` is above or below the `fill`. In SVG content, `markers` can also be ordered. For example, `paint-order: markers stroke fill;` will draw the markers, then stroke, then fill."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Edits here with these motivations:

  • I read "above or below" as meaning the vertical axis and I've made an attempt to clear this up. I don't know if I succeeded.
  • Using values as both literals and words strikes me as a bold stylistic choice. Since we don't really know where these things will end up, I'm taking a more conservative approach.
  • I should probably write it up in the guidelines, but we ought to prefer the present tense whenever it makes sense.
Suggested change
description: "The `paint-order` CSS property sets whether the `stroke` is above or below the `fill`. In SVG content, `markers` can also be ordered. For example, `paint-order: markers stroke fill;` will draw the markers, then stroke, then fill."
description: "The `paint-order` CSS property sets the z-order of strokes, fills, and (in SVG content) markers. For example, `paint-order: markers stroke fill;` draws the markers, then stroke, then fill."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is an improvement. I am on the fence on whether it is clear that the later layers might cover up earlier layers, as it is reliant on the "paint" metaphor, and not explicitly stated. Thoughts?

@jamesnw jamesnw requested a review from ddbeck September 9, 2024 18:18
features/paint-order.yml Outdated Show resolved Hide resolved
jamesnw and others added 2 commits September 10, 2024 09:45
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
@jamesnw jamesnw requested a review from ddbeck September 10, 2024 13:45
@ddbeck ddbeck merged commit 0292959 into web-platform-dx:main Sep 10, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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.

4 participants