Open kizu opened 1 month ago
Yeah, that would be useful in a lot of cases.
It might be smart to do something similar to Scroll-driven Animations, where view-timeline-inset: auto
is specced to use the values of scroll-padding
while it is still possible to specify a custom length-percentage value.
Was playing with the
position-visibility: anchors-visible
(https://drafts.csswg.org/css-anchor-position-1/#position-visibility), and I think it might be useful to take the scrollable area'sscroll-padding
or the anchor'sscroll-margin
into consideration (https://drafts.csswg.org/css-scroll-snap/#propdef-scroll-padding). An example: https://codepen.io/kizu/pen/BaedPEBhttps://github.com/w3c/csswg-drafts/assets/177485/378c29d2-6785-477a-8f2f-13f5be9f265c
Here we can see how if we have some fixed element reducing the effective visible area of our scrollable container, we'd want to consider it for the
position-visibility
. Hooking it ontoscroll-margin
andscroll-padding
sounds logical, as this is very similar to other similar cases like scrolling or snapping to the targeted element.