Socket
Book a DemoInstallSign in
Socket

postcss-scrollbar

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-scrollbar

PostCSS plugin enabling custom scrollbars

Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
2.9K
-10.69%
Maintainers
1
Weekly downloads
 
Created
Source

postcss-scrollbar

npm version Build Status Coverage Status

PostCSS plugin enabling custom scrollbars

Spec : https://drafts.csswg.org/css-scrollbars-1
Browser support: https://caniuse.com/#feat=css-scrollbar
Docs: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Scrollbars

Installation

npm install postcss-scrollbar --save-dev

or

yarn add postcss-scrollbar --save-dev

Usage

const fs = require('fs');
const postcss = require('postcss');
const scrollbar = require('postcss-scrollbar');

let input = fs.readFileSync('input.css', 'utf8');

postcss()
  .use(scrollbar)
  .process(input)
  .then(result => {
    fs.writeFileSync('output.css', result.css);
  });

Examples

/* input */
.scrollable {
  scrollbar-color: rebeccapurple green;
  scrollbar-width: thin;
}
/* output */
.scrollable::-webkit-scrollbar-thumb {
  background-color: rebeccapurple;
}
.scrollable::-webkit-scrollbar-track {
  background-color: green;
}
.scrollable::-webkit-scrollbar {
  width: 0.5rem;
}
.scrollable {
  -ms-overflow-style: auto;
  scrollbar-color: rebeccapurple green;
  scrollbar-width: thin;
}
/* input */
.scrollable {
  scrollbar-width: none;
}
/* output */
.scrollable::-webkit-scrollbar {
  width: 0;
}
.scrollable {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

options

edgeAutohide

type: Boolean
default: false
Allows for setting the scrollbar behaviour for the Edge Browser.
-ms-overflow-style: -ms-autohiding-scrollbar;
Edge doesn't support scrollbar styling.
See https://developer.mozilla.org/fr/docs/Web/CSS/-ms-overflow-style

Credits

  • Pascal Duez

Licence

postcss-scrollbar is unlicensed.

Keywords

css

FAQs

Package last updated on 12 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts