-
-
Save amit08255/9f58d6fd70bb8f4e0df2ccc08b0e77f9 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