Calculate the scrollbar width
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.babelrc Setup Aug 28, 2018
.browserslistrc Setup Aug 28, 2018
.eslintrc Setup Aug 28, 2018
.gitignore Setup Aug 28, 2018
CHANGELOG.md Setup Aug 28, 2018
LICENSE Setup Aug 28, 2018
README.md Fix readme typos Aug 28, 2018
index.js Setup Aug 28, 2018
npm-shrinkwrap.json Setup Aug 28, 2018
package.json Setup Aug 28, 2018
rollup.config.js Setup Aug 28, 2018
yarn.lock Setup Aug 28, 2018

README.md

Scrollbar width

Installation

yarn add @mvsde/scrollbar-width
# or
npm install @mvsde/scrollbar-width

Usage

import scrollbarWidth from '@mvsde/scrollbar-width'

// Get the width of the scrollbar
const width = scrollbarWidth()

// Check if page has overflow and then get scrollbar width
const widthWithOverflowTest = scrollbarWidth({ testOverflow: true })