Last active
December 21, 2022 15:31
-
-
Save pandauxstudio/d91860cbdfc2d12526ce04f8c4eb829b to your computer and use it in GitHub Desktop.
Sass mixin to hide scrollbar in Chrome, Firefox, Safari and IE.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin hideScrollbar { | |
// https://blogs.msdn.microsoft.com/kurlak/2013/11/03/hiding-vertical-scrollbars-with-pure-css-in-chrome-ie-6-firefox-opera-and-safari/ | |
// There is a CSS rule that can hide scrollbars in Webkit-based browsers (Chrome and Safari). | |
&::-webkit-scrollbar { | |
width: 0 !important | |
} | |
// There is a CSS rule that can hide scrollbars in IE 10+. | |
-ms-overflow-style: none; | |
// Use -ms-autohiding-scrollbar if you wish to display on hover. | |
// -ms-overflow-style: -ms-autohiding-scrollbar; | |
// There used to be a CSS rule that could hide scrollbars in Firefox, but it has since been deprecated. | |
scrollbar-width: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about placing a
height: 0 !important;
rule as well to hide horizontal scrollbar as well?