Skip to content

Commit

Permalink
Merge pull request #14 from reslear/feat/scrollbar-default
Browse files Browse the repository at this point in the history
feat: add `scrollbar-default` default state
  • Loading branch information
reslear committed Oct 16, 2021
2 parents 3edffd4 + 4667684 commit 150e5e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

[![npm](https://img.shields.io/npm/v/tailwind-scrollbar-hide)](https://www.npmjs.com/package/tailwind-scrollbar-hide)
![npm](https://img.shields.io/npm/dt/tailwind-scrollbar-hide)

tailwindcss plugin hide scrollbar
![Dependents (via libraries.io)](https://img.shields.io/librariesio/dependents/npm/tailwind-scrollbar-hide)

[Demo](https://reslear.github.io/packages/tailwind-scroll-hide/index.html)

Expand All @@ -17,6 +16,9 @@ npm install tailwind-scrollbar-hide

# Using Yarn
yarn add tailwind-scrollbar-hide

# Using pnpm
pnpm add tailwind-scrollbar-hide
```

Then add the plugin to your `tailwind.config.js` file:
Expand All @@ -41,3 +43,9 @@ Use in you template `scrollbar-hide` for visual hiding scrollbar
```html
<div class="w-4 scrollbar-hide">...</div>
```

or restore default value use `scrollbar-default`

```html
<div class="w-4 scrollbar-hide md:scrollbar-default">...</div>
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwind-scrollbar-hide",
"version": "1.0.2",
"version": "1.0.3",
"description": "tailwindcss plugin for hide scrollbar",
"main": "src/index.js",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ const scrollbarHide = plugin(function ({ addUtilities }) {
'&::-webkit-scrollbar': {
display: 'none'
}
},
'scrollbar-default': {
/* Firefox */
'scrollbar-width': 'auto',

/* Safari and Chrome */
'&::-webkit-scrollbar': {
display: 'block'
}
}
})
})
Expand Down

0 comments on commit 150e5e7

Please sign in to comment.