tailwind-scrollbar
Advanced tools
Comparing version 1.0.1 to 1.1.2
@@ -51,3 +51,3 @@ const plugin = require('tailwindcss/plugin'); | ||
module.exports = plugin(function ({ e, addUtilities, theme, addBase }) { | ||
module.exports = plugin(function ({ e, addUtilities, theme, addBase, variants }) { | ||
const generateScrollbarColorUtilities = (colors, prefix = '') => Object.entries(colors) | ||
@@ -92,3 +92,3 @@ .reduce((memo, [key, value]) => ({ | ||
...generateScrollbarColorUtilities(theme('colors', {})) | ||
}); | ||
}, variants('scrollbar')); | ||
}); |
{ | ||
"name": "tailwind-scrollbar", | ||
"version": "1.0.1", | ||
"version": "1.1.2", | ||
"description": "Tailwind plugin for styling scrollbars", | ||
@@ -5,0 +5,0 @@ "author": "Graham Still <gstill92@gmail.com>", |
@@ -15,4 +15,2 @@ # Scrollbar Plugin for Tailwind CSS | ||
## Usage | ||
Add it to the plugins array of your Tailwind config. | ||
@@ -23,10 +21,23 @@ | ||
// ... | ||
require('tailwind-scrollbar')(), | ||
require('tailwind-scrollbar'), | ||
], | ||
``` | ||
## Usage | ||
For every element that you want to style, add either the `.scrollbar` or `.scrollbar-thin` class. You may then add any `scrollbar-track-{color}`, `scrollbar-thumb-{color}` or `hover:scrollbar-thumb-{color}` classes you like. (Note that `hover:scrollbar-thumb-{color}` classes only have effects in webkit-based browsers. | ||
## Configuration | ||
If you'd like to add varients for the scrollbar utilities (e.g. [dark mode](https://tailwindcss.com/docs/dark-mode)), add them to the `variants` object in your Tailwind config: | ||
``` | ||
variants: { | ||
// ... | ||
scrollbar: ['dark'] | ||
} | ||
``` | ||
## License | ||
This project is licensed under the [MIT License](/LICENSE). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2988964
42