-
Notifications
You must be signed in to change notification settings - Fork 186
Split CSS shape functions #3340
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
base: main
Are you sure you want to change the base?
Conversation
features/shapes.yml
Outdated
@@ -1,17 +1,12 @@ | |||
name: shapes | |||
description: The `circle()`, `ellipse()`, `inset()`, `polygon()`, `rect()`, and `xywh()` CSS shape functions create shapes for use with `clip-path` and `shape-outside`. | |||
description: The `circle()`, `ellipse()`, `inset()`, `polygon()`, CSS shape functions create shapes for use with `clip-path` and `shape-outside`. |
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.
description: The `circle()`, `ellipse()`, `inset()`, `polygon()`, CSS shape functions create shapes for use with `clip-path` and `shape-outside`. | |
description: The `circle()`, `ellipse()`, `inset()`, and `polygon()` CSS shape functions create shapes for use with `clip-path` and `shape-outside`. |
features/rect-xywx.yml
Outdated
@@ -0,0 +1,9 @@ | |||
name: rect() and xywh() | |||
description: The `rect()` CSS function creates a shape with insets from the edges of an element, and the `xywh()` CSS function creates a shape with an `x` and `y` distance, and a width and height. They can be used with `clip-path` and `shape-outside`. |
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.
Optional suggestion here. The way this is written doesn't make it clear that these things are alike. Maybe a phrasing like this would help?
description: The `rect()` CSS function creates a shape with insets from the edges of an element, and the `xywh()` CSS function creates a shape with an `x` and `y` distance, and a width and height. They can be used with `clip-path` and `shape-outside`. | |
description: The `rect()` CSS function creates a rectangle shape with insets from the edges of an element. The `xywh()` CSS function creates a rectangle shifted by an `x` and `y` distance. They can be used with `clip-path` and `shape-outside`. |
features/shapes.yml
Outdated
@@ -1,17 +1,12 @@ | |||
name: shapes | |||
description: The `circle()`, `ellipse()`, `inset()`, `polygon()`, `rect()`, and `xywh()` CSS shape functions create shapes for use with `clip-path` and `shape-outside`. | |||
description: The `circle()`, `ellipse()`, `inset()`, `polygon()`, CSS shape functions create shapes for use with `clip-path` and `shape-outside`. |
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.
Strictly speaking, we could follow the feature splitting guideline here. We'd end up with a kind: split
feature that targets something like:
- circle-ellipse-inset-polygon (this feature, shapes minus rect and xywh—there might be a better ID we could come up with)
- rect-xywx
- shape-function
That said, I think there's something slightly tricky here: the caniuse key (along with a compute_from) indicates that we intended this to follow caniuse's CSS Shapes Level 1 feature. So there are two possible ways to interpret this PR:
- We're correcting the description to match caniuse, then cleaving some keys into new features silently (e.g., our description was mistaken, but the feature's gist was correct). If it's this, the PR is fine as written.
- We're splitting up a monolithic feature into multiple parts (e.g., our feature was badly conceived). If it's this, then we ought to use the
kind: split
.1
My preference is to do what is less confusing for developers. But it's not clear that anyone is relying on us for a definition of "shapes", so maybe the redirect is needless indirection? I think @jamesnw saying what he was thinking when he wrote the PR would be a very helpful clue.
Footnotes
-
Later on, when we solve the "composite feature" problem, we could reinstate
shapes
as the superset of all the features described in this PR. ↩
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.
Hmm, I think it's somewhere between #1 and #2. This is partly to match caniuse (and to properly reflect the disparate release dates) on the existing feature. But I also think it's true that rect()
, xywh()
and shape()
probably should have been separate features, but weren't due to the coverage push.
As far as less confusing to developers, I think it's a case where separate is less confusing until everything is Baseline high, and then joined is less confusing.
I'm open to a split, but agree that people likely aren't relying on this feature to include the newer ones. Given all this, what do you recommend?
FWIW my opinion is that caniuse trying to cover Basically I think we should consider the current definition to be an unintentional mismatch from what was intended (assuming the intent was to match caniuse) and therefore consider it OK to land this PR as is. But I'm also OK with splitting it explicitly, if people prefer that. |
Addresses #3326
Adds features for:
Removes the computed_from from
shapes
.Thanks to @vwallen for review.