Created
August 28, 2022 18:40
-
-
Save dbugshe2/7f4d48a3f0400c99c36f13d000560cc8 to your computer and use it in GitHub Desktop.
A tailwind plugin to hide those pesky overflow scrollbars
This file contains hidden or 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
const plugin = require('tailwindcss/plugin') | |
const scrollbarHide = plugin(function ({ addUtilities }) { | |
addUtilities({ | |
'.scrollbar-hide': { | |
/* IE and Edge */ | |
'-ms-overflow-style': 'none', | |
/* Firefox */ | |
'scrollbar-width': 'none', | |
/* Safari and Chrome */ | |
'&::-webkit-scrollbar': { | |
display: 'none' | |
} | |
}, | |
'.scrollbar-default': { | |
/* IE and Edge */ | |
'-ms-overflow-style': 'auto', | |
/* Firefox */ | |
'scrollbar-width': 'auto', | |
/* Safari and Chrome */ | |
'&::-webkit-scrollbar': { | |
display: 'block' | |
} | |
} | |
}, ['responsive']) | |
}) | |
module.exports = scrollbarHide |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment