ScrollArea: set the offsetScrollbars gap independently of scrollbarSize #9288
ReemX
started this conversation in
Feature requests
Replies: 1 comment
|
Sounds good, a PR is welcome. Please add the CSS variable only, without a new prop:
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Mantine team, and thanks again for shipping
verticalScrollbarPosition(#9036). It cleaned up all of our RTL overrides.A small follow-up on the same component.
offsetScrollbarsreserves its gap withvar(--scrollarea-scrollbar-size), which is the same variable that sizes the scrollbar track. So the gap is always exactly as wide as the scrollbar, and the only way to change one is to change the other.We use thin hover scrollbars (
scrollbarSize={8}) over lists of cards. With an 8px gap, the thumb sits right against the card edges, and we'd like a few more pixels of air without making the scrollbar thicker. Today that means overriding the viewport padding with!important, and the override also has to mirror thedata-vertical-scrollbar-positionleft/right rules, or the gap ends up on the wrong side. That's the same kind of override pile that #9036 removed.Would you be open to letting the offset size be set separately from the scrollbar size? Two shapes that would both work for us:
It looks like a CSS-only change: add
--scrollarea-offset-sizeto the root vars, defaulting tovar(--scrollarea-scrollbar-size), and use it in place of the scrollbar-size variable in thepadding-*rules of the offset block (inline-end, left/right and bottom). The default stays identical, so nothing changes for existing users.Happy to open a PR with the variable (and the prop, if you want one), a test and the docs entry, if this direction sounds right.
Thanks!
All reactions