-
Notifications
You must be signed in to change notification settings - Fork 717
[css-transitions] smoothly transitioning scrollbars in/out when it appears/disappears #6844
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
Comments
@emattias Are you concerned about the impact on layout being abrupt, or the visual appearance of the scrollbar being abrupt? I think |
Since everything else on the page can be smootly transitioned/animated I think this should also be able to do this. Similar to how you can do: html {
scroll-behavior: smooth;
} I think you should be able to do something like: html {
scrollbar-transition: smooth;
} (Any maybe with some options for timing etc.) The problem with |
I agree with @fantasai that this is a browser QoL issue. On Windows, we use a fade transition between 'shy' and 'visible' states of the scrollbar. |
The problem is that So now we have to have this abrupt jump when opening modals: Its especially noticable when a modal is animated in smoothly. Can't the browser provide a way to have this be smooth also? Giving developers more control of the "empty scrollbar gutter" might be a way to solve this problem also. |
I mean, that "space left when the content is not overflowing" is the entire point of scrollbar-gutter, yeah - it means you don't have any layout shift between the scrolling and non-scrolling space. Can you give a markup example that's causing you problems with things not extending to the full width? |
Yes I understand that. I am not questioning having the space. Just that its an inaccessible area for developers to style. And this makes it unusable in many situations unless the scrollable area that has I would like the web platform to have a better solution for this. The 2 options I can come up with is that the transition between showing/hiding scrollbar area be animated or/and having more control of the scrollbar-gutter area.
I threw together a codepen: https://codepen.io/emattias/pen/wvmvaZK?editors=1100 showing the problem. Also, I noticed now that in chrome it looks like this: and firefox like this: Is it a chrome bug? |
I noticed that you used the |
@bmathwig I'm not following. scrollbar-gutter is applied to Anyway, I still think scrollbar-gutter is unusable for many sites/apps because of the reasons I mentioned before. |
When the scrollbar is shown/hidden can be very jarring and cause the page to jump. The scrollbar-gutter and scrollbar-width CSS properties gives us some control but to my knowledge it doesn't allow us to make the transition from scrollbar to no scrollbar (and vice versa) a transition rather than a jump.
If this is the wrong place to post this, please let me know where I should post it and I'll do it :)
The text was updated successfully, but these errors were encountered: