Hide scrollbar while maintaining functionality #2394
Replies: 7 comments
-
nice to have this |
Beta Was this translation helpful? Give feedback.
-
How to Write inline style for the same for react |
Beta Was this translation helpful? Give feedback.
-
Super nice! It solved my problem. Just one thing. If you're already using Tailwind which I guess here we all do xD You can put in a TW layer @layer utilities {
@variants responsive {
/* Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
}
} This way you can use with responsive classes like |
Beta Was this translation helpful? Give feedback.
-
Submitted a PR to add One such class is Edit: Unfortunately this PR was rejected as the team want to take a proper look at all scrollbar styling possibilities to come up with the right API. |
Beta Was this translation helpful? Give feedback.
-
Bump |
Beta Was this translation helpful? Give feedback.
-
bump |
Beta Was this translation helpful? Give feedback.
-
In case anyone comes across this discussion looking for a solution I've made an npm package with utility classes for scrollbar-width (among others) See https://github.com/lukewarlow/tailwind-scrollbar-utilities This makes use of the legacy |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be helpful to have a
.no-scrollbar
class that hides the scrollbar without removing its functionality, this is the code:Beta Was this translation helpful? Give feedback.
All reactions