tailwind-scrollbar-hide
Version:
tailwindcss plugin for hide scrollbar
30 lines (29 loc) • 865 B
JavaScript
/**
* Tailwind plugin for hide scrollbars, although the element can still be scrolled if the element's content overflows.
*/
const scrollbarHide = ({ addUtilities }) => addUtilities({
'.scrollbar-hide': {
// TODO: remove IE and Edge support
/* IE and Edge */
'-ms-overflow-style': 'none',
/* Firefox */
'scrollbar-width': 'none',
/* Safari and Chrome */
'&::-webkit-scrollbar': {
display: 'none'
}
},
'.scrollbar-default': {
// TODO: remove IE and Edge support
/* IE and Edge */
'-ms-overflow-style': 'auto',
/* Firefox */
'scrollbar-width': 'auto',
/* Safari and Chrome */
'&::-webkit-scrollbar': {
display: 'block'
}
}
});
// override type for v3/4 compatibility
export default scrollbarHide;