Closed Toby222 closed 2 years ago
Scroll makes the scroll bar be there all the time, meaning the page size won't change when you switch between tabs of different heights
Yeah, but scroll keeps the scrollbar even when the screen is big enough.
The only ways I can see that would avoid that would be a media query that disables the scroll bar for screens above a certain size (1409px, seems like?), which would require hard-coding that size (as well as depending on non-standard css). Or using JS to figure out the size of the biggest of the tabs and to check if the window is tall enough, with a corresponding onresize event handler that additionally would have to be called when tab contents change as well, which doesn't seem too easy.
I was talking about the
auto
value ofoverflow
which automatically does that for you (mdn).
auto
works when the content overflows. I prefer to keep the scroll bar because page height changes when switching tabs, causing the page to overflow or stop overflowing and the scroll bar to appear and disappear.
This causes a layout shift that's uglier to look at than just a temporarily unused scroll bar, imho.
Obviously the problem is a bit different on screens large enough to fit the largest tab without scrolling.
I really did my best. Check on https://spaceship-incremental-j2s35gppt-toby222.vercel.app/ whether everything is correct before merging.