- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Thu, 01 May 2025 22:09:15 +0000
- To: public-css-archive@w3.org
Per the [current model in the spec](https://drafts.csswg.org/css-logical/#box), we cascade logical and physical longhands independently, then associate them early in computed-value time (after `writing-mode` and `direction` have been computed), and treat both associated properties as having the cascaded value of whichever one has the highest, uh, not technically specificity but "cascade winning-ness" (since it depends on more than just the specificity). Basically we retcon things as if the associated properties were actually the same single property in the stylesheet. (Within a single rule, order of declarations thus matters: in an English document, whether you specify `border-left: 5px; border-inline-start: 10px;` or `border-inline-start: 10px; border-left: 5px;` changes whether those two properties end up being `5px` or `10px`. This is a new concept that isn't required for anything else, since otherwise order of declarations is resolved at parse-time by just throwing out earlier declarations.) The issue, then, is about what properties a shorthand *actually expands to*. Saying `margin: logical 10px;` should set `margin-block-start: 10px;`/etc, while `margin: 10px;` should set `margin-top: 10px;`/etc. If you just say `margin: var(--foo);`, tho, it could be either. You can't set *all* of them, both physical *and* logical, to a "pending" value tho, because then whichever set comes second overrides the set that comes first, even if it turns out that the first set is what was actually defined by the var(). So there's a design issue there. If the physical/logical switch is in the value space, variables can mean that it hides until computed-value time, but it needs to be known at parse time. If the switch *isn't* in the value space (say it's `margin: 10px !logical;` or something), then it's impossible to set logical values via variables and similar things, since they can't expand into the ! portion of a declaration. -- GitHub Notification of comment by tabatkins Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9690#issuecomment-2845889155 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 1 May 2025 22:09:16 UTC