Re: [csswg-drafts] [css-position][css-sticky] Make sticky positioning less restrictive (#5528)

To address the limitation of the current implementation, I would like to propose changing the syntax of sticky positioning to:

For defining the parent element:
```
/* Number values */
/* 1 means the first closest parent, 2 means the second closest parent, and so on */
sticky-parent: 1;
sticky-parent: 2;
sticky-parent: 3;

/* Selector values */
/* the number refers to the order of the closest matched selector, defaults to 1 */
sticky-parent: "article";
sticky-parent: "#post";
sticky-parent: "div" 2;
sticky-parent: "section" 3;
```

For defining the position:
```
/* Keyword values */
sticky-position: top;
sticky-position: right;
sticky-position: bottom;
sticky-position: left;

/* Percentage values */
sticky-position: 25% 75%;

/* Length values */
sticky-position: 0 0;
sticky-position: 1cm 2cm;
sticky-position: 10ch 8em;

/* Edge offsets values */
sticky-position: bottom 10px right 20px;
sticky-position: right 3em bottom 10px;
sticky-position: bottom 10px right;
sticky-position: top right 10px;
```

For shorthand:
```
/* sticky: <parent>, <position>; */
sticky: 1, top;
sticky: "article", right;
sticky: "div" 2,  25% 75%;
sticky: "section" 3,  top right 10px;
```

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


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

Received on Saturday, 19 September 2020 03:45:05 UTC