Re: [csswg-drafts] [selectors-5] Proposal for pseudo-selector :overflowed-content (#2011)

Here is a case which needs overflow as condition, consider the case that we has some elements position at right, and we need to keep those elements has same visual position at non-overflow and overflow case:

```css
.container {
  padding-right: 40px; // non-overflow case, padding right 40px
}
```

```txt
|--------------------------------------------------------------------------------------------------------|
|                                                                                                        |
|                                               _______________________________________________          |
|                                               | This is a search box.                    🔍 |         |
|                                               |----------------------------------------------|         |
|                                                                                                        |
|                                                                                                        |
|                                                                                                        |
|                                                                                                        |
|                                                                                                        |
|                                                                                                        |
|                                                                                                        |
|--------------------------------------------------------------------------------------------------------|
```


```css
.container :overflow-y {
    padding-right: 30px;  // overflow-y case, vertical scroll bar takes up 10px space, 
                                       // adjust the padding to keep align with non-overflow case.
}
```
```txt
|--------------------------------------------------------------------------------------------------------|
|                                                                                                        |
|                                               _______________________________________________          |
|                                               | This is a search box.                    🔍 |         |
|                                               |----------------------------------------------|         |
|                                                                                                      | |
|                                                                                                      | |
|                                                                                                      | |
|                                                                                                      | |
|                                                                                                      | |
|                                                                                                        |
|                                                                                                        |
|--------------------------------------------------------------------------------------------------------|
```

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


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

Received on Friday, 5 February 2021 09:10:54 UTC