Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-overflow] Ability to ignore specific descendants when generating scrollbars #8400

Closed
LeaVerou opened this issue Feb 5, 2023 · 4 comments

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Feb 5, 2023

Problem: Positioned box "decorations": ribbons, complex shadows (that require pseudo-elements) and other ornamental elements or pseudo-elements. causing scrollbars to be generated when they should be ignored when scrollbars are calculated.

E.g. for the ribbon here I had to use position: fixed and JS to hide it when the page is scrolled.

image

And in other cases even position: fixed doesn't help, and the decoration still generates scrollbars, with no straightforward workaround (complex workarounds include wrappers with overflow: hidden and fragile sizing).

Perhaps a property that basically says "ignore this element when calculating scrollbars", which would only apply to positioned elements only, syntax TBB. @fantasai @frivoal thoughts?

@ydaniv
Copy link
Contributor

ydaniv commented Feb 5, 2023

Another common use case is for content that's animated into view when it's fold enters the viewport. So if that element would naturally be expected not to generate scrollbars, it may generate them on the beginning of the animation, and avoiding it in a generic way is a hassle, and requires fixing the problem outside the element's scope.
So another interesting point is if it could be animatable discrete.

@LeaVerou
Copy link
Member Author

LeaVerou commented Feb 5, 2023

Another common use case is for content that's animated into view when it's fold enters the viewport. So if that element would naturally be expected not to generate scrollbars, it may generate them on the beginning of the animation, and avoiding it in a generic way is a hassle, and requires fixing the problem outside the element's scope. So another interesting point is if it could be animatable discrete.

Thank you, I have come across this quite a lot as well!

@johannesodland
Copy link

johannesodland commented Feb 6, 2023

I’ve often come across the same issue.

In some cases workarounds such as overflow: hidden and contain: paint can’t be used. That happens when the elements are transformed in a 3d context. overflow:hidden can’t be used as it is a grouping property that forces preserve-3d: flat.

I’ve tried to suggest a method to prevent elements from contributing to scrollable overflow area here: #8361

@tabatkins
Copy link
Member

Yeah, this appears to be a dupe of #8361, which came in slightly earlier. @LeaVerou, mind closing this in favor of the other issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants