[css-values] toggle() for shorthands is not forward compatible
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
https://drafts.csswg.org/css-values/#funcdef-toggle
If toggle() is used on a shorthand property, it sets each of its longhands to a toggle() value with arguments corresponding to what the longhand would have received had each of the original toggle() arguments been the sole value of the shorthand.
Let's consider display: toggle(block, flow-root, inline).
Right now, display is a longhand property, so we have:
block flow->block flow-rootblock flow-root->inline flow- anything else ->
block flow
But it seems likely that we will want to convert display into a shorthand. Then, the example will become
display-outside: toggle(block, block, inline);
display-inside: toggle(flow, flow-root, flow);
Due to short-circuiting, that's equivalent to
display-outside: block;
display-inside: toggle(flow, flow-root);
Which behaves like
block flow->block flow-root- anything else ->
block flow
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the toggle() definition in the linked CSS Values specification section and compare its shorthand-property wording with the display example in this issue. Done means the specification resolves the forward-compatibility concern and defines behavior that remains consistent if display becomes a shorthand.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100