Re: [csswg-drafts] [css-anchor-1] `anchor()` inside an `inset` shorthand (#8582)

@tabatkins I'm re-reading the specs, and I think the wording in the place about the `auto` and `auto-same` could be improved a bit: from the specs text it _sounds_ like the `inset: anchor(--foo auto-same);` won't work due to this:



> If a positioned element uses the anchor() function with the auto or auto-same keywords in one of its inset properties, **and the opposing inset property is auto**,

and this:

> Automatic anchor positioning is only active if the opposite inset property is auto.

`inset: … auto-same` would feel like it won't work, as it would be not `auto` on the opposing side, but `auto-same`.

In addition to that, I'm wondering if the whole “If this is not the case, the anchor() function represents an invalid anchor query, and the element does not use automatic anchor positioning in that axis” makes it impossible to just use the `auto` and `auto-same` as shortcuts for the “opposing side” and “same side” when the other side is not `auto`, but some specific calculation.

I think, an ability to use `auto` and `auto-same` just as the shortcuts for the sides can be very helpful when defining anchors as reusable custom properties, or as parts of the fallback definitions.

What if we would split the part where the keyword works as the side/opposing side, and where it provides the automatic position-fallback, making the “opposing side needs to be auto” to apply only for the fallback part, keeping the side shortcuts working as is? This would make the `inset` work, and would unlock the keywords for the non-fallback use-cases.

-- 
GitHub Notification of comment by kizu
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8582#issuecomment-1554232496 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 19 May 2023 08:33:14 UTC