-
Notifications
You must be signed in to change notification settings - Fork 716
[css-values] toggle() for shorthands is not forward compatible #6764
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
Comments
@mirisuzanne recently proposed using @container style queries to solve the use cases of toggle(), so maybe it makes sense to do that and drop toggle() entirely. |
If toggle() can be replaced with something else then it's fine, but this issue doesn't mean that it's unsalvageable. I guess toggle() in a shorthand should set the longhands to a pending-toggle-resolution internal value, that would serialize as empty string and cascade as normally. At computed value time we would resolve that by taking the shorthand, and evaluating it to each of the values in toggle(). If all longhands would have the same computed value as the parent element, then it's a match. Then we pick the corresponding longhand component of the next toggle value. |
Ah, that's a great example, and definitely demonstrates the current spec text as being somewhat broken. I agree that leaning on the identical solution we have for variables is probably what we'd have to do. |
Uh oh!
There was an error while loading. Please reload this page.
https://drafts.csswg.org/css-values/#funcdef-toggle
Let's consider
display: toggle(block, flow-root, inline)
.Right now,
display
is a longhand property, so we have:block flow
->block flow-root
block flow-root
->inline flow
block flow
But it seems likely that we will want to convert
display
into a shorthand. Then, the example will becomeDue to short-circuiting, that's equivalent to
Which behaves like
block flow
->block flow-root
block flow
The text was updated successfully, but these errors were encountered: