Scrolling bar reflowing | CSS Trucks

This is a bit of advice for developers on Max that I’ve heard many times, and I’ll repeat: go in. Show System Preferences> General> Scroll Bar. And set Always. It’s not about you, it’s about the web. See, the problem is that without this layout, you will never experience dynamic layout shifts from the scroll bar, but with this layout everyone will be on their own. Since you want to design to avoid this type of junk, you should use this setting yourself.

Here Stephen Judy shows that the use of viewport units may be a factor.

there, 100vw Horizontal overflow causes, because the vertical scroll bar was already in play, taking up some of it. It seems that. Incredibly wrong Somehow for me, but here we are.

Stephen refers to Kalyan Walkhov’s article on dealing with it. Classic fixes:

Easy to use solution. width: 100% The percentage does not include the width of the scroll bar, so it will fit automatically.

Add if you can’t, or you’re setting the width on another element. overflow-x: hidden Or overflow: hidden The surrounding element to stop the scroll bar.

کلیان والخوف۔, “How to find the cause of horizontal scroll bars”

These are hexes, I would say, because they are both things that are not exactly what you wanted them to do.

Fortunately, there is a predictable solution to come. Brams has the scope:

One side effect when displaying the scroll bar on the web is that the order of content may vary according to the type of scroll bar. Of scrollbar-gutter The CSS property – which will soon be shipped with Chromium – is intended to give us developers greater control over it.

Brams Van Dyke.“Prevent unwanted layout shifts due to scroll bars. scrollbar-gutter CSS Property “

Sounds like a trick, and I wouldn’t be surprised if it becomes a very common line in the reset styling sheet:

body {
  scrollbar-gutter: stable both-edges;

It amazes me though. <body> When dealing with it at the full page level, right? It’s not <html>? This has been strange in the past with things related to scrolling.

Are we actually going to roll it out to all browsers? Who knows It seems possible to some extent, but even if it gets closer, and the attitude becomes clearer, I go for it. The rise of progressivism feels friendly.

Leave a Reply

Your email address will not be published.