3 ms·
The website https://bansal.io/pattern-css https://bansal.io/pattern-css was clearly produced on a platform with overlay scrollbars. There are a number of horizo
by chrismorgan 7y ago
The website https://bansal.io/pattern-css https://bansal.io/pattern-css was clearly produced on a platform with overlay scrollbars. There are a number of horizontal scrollbars that shouldn’t be there.
.overflow-scroll {
overflow: scroll !important;
}
`overflow: scroll` is pretty much never what you want: it draws scrollbars whether needed or not. You want `overflow: auto` instead, which doesn’t draw scrollbars unless necessary.
.w-100vw {
width: 100vw !important;
}
Viewport units are fundamentally broken by design. Don’t ever use them for layout. In fact I recommend against using them in any situation at all. In this case, use `width: 100%` or just nothing, and it’ll yield the desired results.
- tekromancr 7y ago> Viewport units are fundamentally broken by design. Don’t ever use them for layout. In fact I recommend against using them in any situation at all. That's a pretty bold claim. Can you elaborate on that?
- chrismorgan 7y agoSome comments I’ve made here on the topic: https://news.ycombinator.com/item?id=21244656 https://news.ycombinator.com/item?id=21244656 https://news.ycombinator.com/item?id=20956850 https://news.ycombinator.com/item?id=20956850 The currently-implemented viewport units are just fundamentally bad. And I’ve only been talking about the badness of vw; vh has further troubles of its own on mobile.
- JoshTriplett 7y agoWhat was Firefox's former behavior for viewport unit handling that other browsers didn't want to go with?
- chrismorgan 7y agohttps://github.com/w3c/csswg-drafts/issues/1766 https://github.com/w3c/csswg-drafts/issues/1766 is the main link that explains it, https://bugzilla.mozilla.org/show_bug.cgi?id=1468684 https://bugzilla.mozilla.org/show_bug.cgi?id=1468684 is also useful.
- preommr 7y agoIt's not that bad... it's just scrollbars and mobile where things get messy.
- coopsmgoops 7y agoWorse than that. Different browsers and different platforms handle scroll bars differently. Some are hidden until hovered and some have width and some don't some only have width when hovered. It's really awful if you're trying to do something with several scrolling columns
- eurasiantiger 7y agoWhy would you do something with several scrolling columns? Scrolling elements inside scrolling elements (such as a page) are an anti-pattern
- xPaw 7y agoNot to mention smooth scroll which takes definitely too much time to scroll for no good reason.