[csswg-drafts] [css-position] Allow setting multiple named box insets (#10754)

johannesodland has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-position] Allow setting multiple named box insets ==
Can we extend the box inset properties to allow authors to set multiple named box insets?

```css
/* Make the element sticky against the scrollport, but only until it's 20px from the containing block */
position: sticky;
inset-block: 
    scrollport 0, 
    containing-block 20px;
```

A missing inset name should be interpreted automatically based on positioning, the same way insets work today. 
(Using `auto` as an inset name would unfortunately be ambigous as it is also valid as a component value.)

```css
position: absolute;
inset: 0;
```


## Motivation

While one set of box insets is sufficient for most positioning schemes, sticky positioning is concerned with both the scrollport and the containing block. Currently authors can use margins to modify the containing block constraints, but the working group [has resolved to ignore margins](https://github.com/w3c/csswg-drafts/issues/9052#issuecomment-1642600755) in sticky-pos calculation.

Margins are problematic as they are also used for in-flow positioning and because it is unclear how collapsing margins would apply. However, there are [existing use cases](https://github.com/w3c/csswg-drafts/issues/9052#issuecomment-1809658376) for modifying the containing block constraints and authors should be provided with a means of specifying that inset.

## Alternative solutions

https://github.com/w3c/csswg-drafts/issues/2496 suggests pulling sticky into a separate property.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10754 using your GitHub account


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

Received on Sunday, 18 August 2024 16:01:25 UTC