Rounded borders + scroll bar

How do you guys deal with cards with rounded border-radius and scroll bar beside it? it doesn't look good imo (screenshot added in the comments)
12 Replies
StefanH
StefanHβ€’2mo ago
I guess you can try adding padding so the scrollbar isn't obscured by the radius?
Jhonz
JhonzOPβ€’2mo ago
the scroll bar actually looks like it's on top of the card, basically breaking how the card looks like. I can't use overflow: hidden because i have other elements that i do want to overlap. in mobile browser, it's not that bad, but still doesn't look great
No description
StefanH
StefanHβ€’2mo ago
have you tried doing the thing i suggested?
Jhonz
JhonzOPβ€’2mo ago
you mean add a padding to the card? mine already has one. This is how it looks like in Chrome desktop
No description
Restemat
Restematβ€’2mo ago
I guess you need an inner container that has the scroll, padding-block on the outer? Also this made me think of Jhey's curved scrollbar, which unfortunately is not a real grabbable scrollbar you can accessibly use I don't think πŸ˜… https://codepen.io/jh3y/pen/zxOJdEe
Chris Bolson
Chris Bolsonβ€’2mo ago
I was thinking about that too πŸ˜† . I didn't take too close a look at it when JHey released it, I just assumed that it would be scrollable. I now see that it isn't so it is more of a scroll "indicator" than a scrollbar.
Jhonz
JhonzOPβ€’5w ago
dang more codes 🀣 if i could just make the scrollbar tucked in while everything else can overflow btw, for context, here's how it is structured <div class="stepList-wrapper"> to contain everything <div class="stepList"> to contain all the instructions/steps (about a certain topic) only <div class="stepInfo"> for the contents of the steps the height of the stepList and stepInfo is calculated by a script that checks which stepInfo has the largest content then kt applies that height to all stepInfo to have a consistency with the looks (limiting the max-height to be just 90% of the viewport's height hence the scroll bar for content that is bigger than the viewport's height. If you guys have other suggestions on how to tell users that there's more below so i can just completely hide the scrollbar, that will be great
Jhonz
JhonzOPβ€’5w ago
i don't know what I'm missing. If I understand this correctly, the padding in container is need to add a gap from the border, then the content has overflow-y: scroll in my case, as per previous post, my height's declared based on content. My stepInfo (which is the content) already has an overflow-y: but set to auto. However, not sure why it is ommited in my screenshot
Chris Bolson
Chris Bolsonβ€’4w ago
This inspired me to work on my own solution. Still things to finish off and tidy up but I will have it on Codepen soon
Jhonz
JhonzOPβ€’4w ago
looks great. please share when you can, and I'll try it on mine I was able to fix mine btw moving the border designs to the container then hiding the overflow (so that includes the scroll bar) but i losed the effect of the card's sliding when moving between steps (unless i make another div which will now be too many)
Chris Bolson
Chris Bolsonβ€’4w ago
This is my demo on Codepen.
Chris Bolson
CodePen
Custom curved scrollbars
Replace the scrollbar and thumb with a custom scrollbar that curves with the border-radius at the top and bottom. ...

Did you find this page helpful?