1 | # unocss-preset-scrollbar-hide
|
2 | unocss preset for hide scrollbars, although the element can still be scrolled if the element's content overflows.
|
3 |
|
4 | same as [tailwind-scrollbar-hide](https://github.com/reslear/tailwind-scrollbar-hide)
|
5 |
|
6 |
|
7 | [![npm](https://img.shields.io/npm/v/tailwind-scrollbar-hide)](https://www.npmjs.com/package/tailwind-scrollbar-hide)
|
8 | ![npm](https://img.shields.io/npm/dt/tailwind-scrollbar-hide)
|
9 | ![npm](https://img.shields.io/npm/dw/tailwind-scrollbar-hide)
|
10 | ![Dependents (via libraries.io)](https://img.shields.io/librariesio/dependents/npm/tailwind-scrollbar-hide?0)
|
11 | [![install size](https://packagephobia.com/badge?p=tailwind-scrollbar-hide)](https://packagephobia.com/result?p=tailwind-scrollbar-hide)
|
12 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
|
13 |
|
14 | ![Firefox >=64 Chrome >= 2 Safari >= 4 Internet Explorer >= 10 ](https://badges.herokuapp.com/browsers?googlechrome=2&firefox=64&safari=4&iexplore=10)
|
15 | -->
|
16 |
|
17 | ![tailwind-scrollbar-hide animation demo](https://user-images.githubusercontent.com/12596485/142972957-272010d3-29f6-4be7-99e1-dd03e7a8b92b.gif)
|
18 |
|
19 | [Live demo](https://reslear.github.io/packages/tailwind-scroll-hide/index.html)
|
20 |
|
21 |
|
22 | ## Installation
|
23 |
|
24 | Install the preset from npm:
|
25 |
|
26 | ```sh
|
27 | # Using npm
|
28 | npm install unocss-preset-scrollbar-hide
|
29 |
|
30 | # Using Yarn
|
31 | yarn add unocss-preset-scrollbar-hide
|
32 |
|
33 | # Using pnpm
|
34 | pnpm add unocss-preset-scrollbar-hide
|
35 | ```
|
36 |
|
37 | Then add the plugin to your `tailwind.config.js` file:
|
38 |
|
39 | ```ts
|
40 | // unocss.config.ts
|
41 | import { presetScrollbarHide } from 'unocss-preset-scrollbar-hide'
|
42 |
|
43 |
|
44 | export default defineConfig({
|
45 | // ...
|
46 | presets: [
|
47 | // ...
|
48 | presetScrollbarHide()
|
49 | ],
|
50 | })
|
51 | ```
|
52 |
|
53 | ## Usage
|
54 |
|
55 | Use in you template `scrollbar-hide` for visual hiding scrollbar
|
56 |
|
57 | ```html
|
58 | <div class="w-4 scrollbar-hide">...</div>
|
59 | ```
|
60 |
|
61 | or restore default value use `scrollbar-default`
|
62 | > ⚠️ webkit overriding not working https://github.com/reslear/tailwind-scrollbar-hide/issues/19#issuecomment-1086949110 need switch breakpoint system
|
63 |
|
64 | ```html
|
65 | <div class="w-4 scrollbar-hide md:scrollbar-default">...</div>
|
66 | ```
|
67 |
|
68 | ## License
|
69 |
|
70 | [MIT](./LICENSE)
|