npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@moncareyws/foundation-perfect-scrollbar

v1.0.4

Published

Perfect Scrollbar as a Foundation plugin

Downloads

199

Readme

foundation-perfect-scrollbar

Perfect Scrollbar plugin for Foundation 6

Installation

npm install --save @moncareyws/foundation-perfect-scrollbar

Add all nessesary files to your html. This plugin only works with foundation and requires perfect-scrollbar.

<link rel="stylesheet" type="text/css" href="node_modules/foundation-sites/dist/css/foundation.css">
<link rel="stylesheet" type="text/css" href="node_modules/foundation-perfect-scrollbar/dist/css/foundation-perfect-scrollbar.css">
...
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/what-input/dist/what-input.js"></script>
<script src="node_modules/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.js"></script>
<script src="node_modules/foundation-sites/dist/js/foundation.min.js"></script>
<script src="node_modules/foundation-perfect-scrollbar/dist/js/foundation.perfectScrollbar.min.js"></script>

If you are using foundation's scss with gulp, the best way add the styles is by adding it to the sass paths in your gulpfile.

var gulp = require('gulp');
var $    = require('gulp-load-plugins')();

var sassPaths = [
    'node_modules/foundation-sites/scss',
    'node_modules/@moncareyws/foundation-perfect-scrollbar/src/scss/plugin',
    'node_modules/motion-ui/src'
];

gulp.task('sass', function() {
    ...

Include the foundation-perfect-scrollbar.scss file

@import "foundation-perfect-scrollbar";

Then add these settings to your _settings.scss file for customization

// Colors
$ps-border-radius: 6px;

$ps-rail-default-opacity: 0;
$ps-rail-container-hover-opacity: 0.6;
$ps-rail-hover-opacity: 0.9;

$ps-bar-bg: transparent;
$ps-bar-container-hover-bg: #aaa;
$ps-bar-hover-bg: #999;
$ps-rail-hover-bg: #eee;

// Sizes
$ps-scrollbar-x-rail-bottom: 0px;
$ps-scrollbar-x-rail-height: 15px;
$ps-scrollbar-x-bottom: 2px;
$ps-scrollbar-x-height: 6px;
$ps-scrollbar-x-hover-height: 11px;

$ps-scrollbar-y-rail-right: 0;
$ps-scrollbar-y-rail-width: 15px;
$ps-scrollbar-y-right: 2px;
$ps-scrollbar-y-width: 6px;
$ps-scrollbar-y-hover-width: 11px;

Usage

Basic html

<div data-perfect-scrollbar>
<!-- Scrollable content -->
</div>

Run foundation and it will automaticaly initialize all the scroll containers

$(document).foundation();

Plugin options

|Name |Default |Descrition| |---------|---------|----------| |handlers|['click-rail', 'drag-scrollbar', 'keyboard', 'wheel', 'touch']|It is a list of handlers to use to scroll the element.| |wheelSpeed|1|The scroll speed applied to mousewheel event.| |wheelPropagation|false|If this option is true, when the scroll reaches the end of the side, mousewheel event will be propagated to parent element.| |swipePropagation|true|If this option is true, when the scroll reaches the end of the side, touch scrolling will be propagated to parent element.| |minScrollbarLength|null|When set to an integer value, the thumb part of the scrollbar will not shrink below that number of pixels.| |maxScrollbarLength|null|When set to an integer value, the thumb part of the scrollbar will not expand over that number of pixels.| |useBothWheelAxes|false|When set to true, and only one (vertical or horizontal) scrollbar is visible then both vertical and horizontal scrolling will affect the scrollbar.| |suppressScrollX|false|When set to true, the scroll bar in X axis will not be available, regardless of the content width.| |suppressScrollY|false|When set to true, the scroll bar in Y axis will not be available, regardless of the content height.| |scrollXMarginOffset|0|The number of pixels the content height can surpass the container height without enabling the Y axis scroll bar. Allows some "wiggle room" or "offset break", so that Y axis scroll bar is not enabled just because of a few pixels.| |initialXPosition|'left'|Automaticaly scroll the content to an initial position, this can the number of px to scroll to or the strings 'left' or 'right'.| |initialYPosition|'top'|Automaticaly scroll the content to an initial position, this can the number of px to scroll to or the strings 'top' or 'bottom'.| |stopPropagationOnClick|true|When set to false, when clicking on a rail, the click event will be allowed to propagate.| |theme|'foundation'|A string. It's a class name added to the container element. The class name is prepended with ps-theme-. So default theme class name is ps-theme-foundation. In order to create custom themes with scss use the ps-container($theme) mixin, where $theme is an scss map.

Licence

MIT Licence