@ayato-san/tailwind-scrollbar
v1.0.0
Published
A tailwind plugin that provides utilities for styling scrollbars.
Maintainers
Readme
Features
- Custom scrollbar variants for different parts of the scrollbar.
- Utilities for setting
scrollbar-gutterwith various values. - Utilities for setting
scrollbar-widthwith different options. - Custom scrollbar colors using
scrollbar-fgandscrollbar-bgutilities.
Install
with NPM
npm install -D tailwindcss @ayato-san/tailwind-scrollbarwith pnpm
pnpm add -D tailwindcss @ayato-san/tailwind-scrollbarwith yarn
yarn add -D tailwindcss @ayato-san/tailwind-scrollbar
Utilities
- Custom scrollbar variants such as
scrollbar,scrollbar-horizontal,scrollbar-vertical,scrollbar-button,scrollbar-thumb,scrollbar-track,scrollbar-track-piece,scrollbar-corner, andscrollbar-resizer. - Utilities to set
scrollbar-gutterwith values likeauto,stable,stable-both,inherit, andinitial. - Utilities to set
scrollbar-widthwith values likeauto,thin, andnone. - Custom scrollbar foreground and background colors using
scrollbar-fgandscrollbar-bgutilities, supporting all colors from the Tailwind CSS color palette.
Preconfiguration
firefox: Scrollbar in firefox's like style
inside the tailwind.config.js
plugins: [require('@ayato-san/tailwind-scrollbar/preconfigured/<name>')]customize preconfiguration
theme: {
scrollbar: {
size: '10px', // the width or height of the scrollbar
padding: '2px', // the padding between the scrollbar and the border
background: { default: '#f0f0f0', hover: '#f4f4f4' }, // the scrollbar tack color
foreground: { default: '#bfbfbf', hover: '#a6a6a6' }, // the scrollbar thumb color
}
}