Giter VIP home page Giter VIP logo

lukewarlow / tailwind-scrollbar-utilities Goto Github PK

View Code? Open in Web Editor NEW
23.0 1.0 1.0 116 KB

Tailwind v3+ plugin to create classes for the scrollbar-gutter, scrollbar-width and scrollbar-color CSS properties.

Home Page: https://www.npmjs.com/package/tailwind-scrollbar-utilities

License: MIT License

TypeScript 100.00%
scrollbar scrollbar-width tailwind tailwindcss scrollbar-gutter css css-scrollbar scrollbars utilties scrollbar-color hacktoberfest

tailwind-scrollbar-utilities's Introduction

TailwindCSS Scrollbar Utilities Plugin

npm

This plugin generates utility classes for scrollbar-gutter, scrollbar-width, and scrollbar-color.

Installation

Add to your project via:

# Install using npm
npm install -D tailwind-scrollbar-utilities

# Install using yarn
yarn add -D tailwind-scrollbar-utilities

Add it to the plugins array of your Tailwind config. Call the functions for the utilities you want to use.

const { scrollbarGutter, scrollbarWidth, scrollbarColor } = require('tailwind-scrollbar-utilities');

plugins: [
	scrollbarGutter(), // no options to configure
	scrollbarWidth(), // no options to configure
	scrollbarColor(), // no options to configure
]

Usage

  • scrollbar-gutter-auto: Adds scrollbar-gutter: auto; to the element.

  • scrollbar-gutter-stable: Adds scrollbar-gutter: stable; to the element.

  • scrollbar-gutter-stable along with scrollbar-gutter-both-edges: Adds scrollbar-gutter: stable both-edges; to the element.

  • scrollbar-width-auto: Adds scrollbar-width: auto; to the element.

  • scrollbar-thin: Adds scrollbar-width: thin; to the element.

  • scrollbar-none: Adds scrollbar-width: none; to the element. It also adds a ::-webkit-scrollbar fallback for better browser support.

  • scrollbar-color-auto: Adds scrollbar-color: auto; to the element.

  • scrollbar-thumb-{color}: Sets the thumb color portion of the scrollbar color property.

  • scrollbar-track-{color}: Sets the track color portion of the scrollbar color property.

  • scrollbar-color: Adds scrollbar-color: {thumb-color} {track-color}; to the element. It's important to note you must set both color values for this to have any effect.

Where {color} is any available tailwind color e.g. scrollbar-thumb-teal-900

You can also use arbitrary values such as scrollbar-track-[Canvas].

License

This project is licensed under the MIT License.

tailwind-scrollbar-utilities's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

arjunyel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.