Tailwind plugin for hide scrollbars, although the element can still be scrolled if the element's content overflows.
🎨 Tailwind v2.x, v3.x, v4.x
🛠️ Port for unocss-preset-scrollbar-hide
Install the plugin from npm:
# Using npm npm install tailwind-scrollbar-hide # Using Yarn yarn add tailwind-scrollbar-hide # Using pnpm pnpm add tailwind-scrollbar-hideThen add the plugin to your config file:
// tailwind.config.js module.exports = { theme: { // ... }, plugins: [ require('tailwind-scrollbar-hide') // ... ] }or using TypeScript:
// tailwind.config.ts import type { Config } from 'tailwindcss' import scrollbarHide from 'tailwind-scrollbar-hide' export default { theme: { // ... }, plugins: [scrollbarHide] } satisfies ConfigUse legacy configuration files like:
/* index.css */ @import 'tailwindcss'; @config "../../tailwind.config.js";Use in you template scrollbar-hide for visual hiding scrollbar
<div class="w-4 scrollbar-hide">...</div>or restore default value use scrollbar-default
⚠️ webkit overriding not working reslear#19 (comment) need switch breakpoint system
<div class="w-4 scrollbar-hide md:scrollbar-default">...</div>