[csswg-drafts] [css-conditional-5]Add `scroll-state(scroll-to)` container feature queries (#11191)

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

== [css-conditional-5]Add `scroll-state(scroll-to)` container feature queries ==
The `overflowing feature` in the current specification is confusing, and @fantasai expressed similar concerns in #11182.

CSS authors often prefer to get a sense of where the container has scrolled to, and then adapt behavior and style.

## Common use cases

1. Display a `back to top` button after scrolling to the bottom of the page.
2. in a horizontally scrolling table or carousel, when scrolling to the left or right, play a “rubber band” animation to indicate that the user has scrolled to the last page.

Demo:

https://github.com/user-attachments/assets/9d4bb71f-cb9a-42f6-8aa8-02241ffb8319

----

In addition, the current `overflowing feature` performs this once every time the page is loaded, which is undesirable in the above use case. This behavior should be avoided if you agree to add `scroll-to`.


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


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

Received on Wednesday, 13 November 2024 10:46:55 UTC