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

ion-custom-scrollbar

v1.1.3

Published

This library is built to fascilitate the the scrollbar design for ionic-framework. The ionic framework is more powerful than ever since you can now build very high quality websites and PWAs along with highly performant apps, all in one codebase.

Downloads

66

Readme

IonCustomScrollbar

This library is built to fascilitate the the scrollbar design for ionic-framework. The ionic framework is more powerful than ever since you can now build very high quality websites and PWAs along with highly performant apps, all in one codebase.

But like every big platforms, there is a custom demand in ionic as well. The creators might not have thought about it but a lot of developers including me had this demand of providing custom scrolbar design. However, as ionic is now made of custom-elements, the scrollbar of ion-content seems to be hiding behind shadowRoot. So, if you are not that much proficient in handling shadowRoot through js, you can not achieve this with simple css or scss.

But even if you do, you have to do it for every ion-content and the process is not mere few lines of codes. You might make a directive but if you are really into ionic then you will have to end up doing so in all your projects.

Hence this thing comes, which you can import as a module and use as directive.

Git Repo

https://github.com/juny58/ion-custom-scrollbar

Installation

Run npm i ion-custom-scrollbar

Usage

Import the module on top of your lazy loaded module and insertinside the 'imports' array inside NgModule.

import { IonCustomScrollbarModule } from 'ion-custom-scrollbar'

@NgModule({
  imports: [
    ...,
    IonCustomScrollbarModule
  ],
  declarations: [...]
})

Then use it in the ion-content like,

<ion-content scrollbar>
   ...
</ion-content>

The default style is:

@media(pointer: fine) {
    ::-webkit-scrollbar {
      width: 12px;
    }
    ::-webkit-scrollbar-track {
      background: #fff;
    }
    ::-webkit-scrollbar-track:hover {
      background: #f7f7f7;
    }
    ::-webkit-scrollbar-thumb {
      background: #ccc;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: #888
    }
    .inner-scroll {
      scrollbar-width: thin
    }
}

Notice that I have used @media(pointer: fine) which is applied for devices with only mouse pointer allowed. This is the native behaviour of html5 scrollbar that it becomes a slim vanishable scrollbar in touch devices. But our concern is only screens where this big scrollbar comes. Hence the style is applied conditionally.

However you can pass your own design as well. Just write your own style as text and pass as scrollbar=<your-custom-scrollbar-style>

<ion-content scrollbar='you-custom-scrollbar-style'>
   ...
</ion-content>

It is better to store your style in a variable and pass it here.

Apply style on all platforms

If you want to apply the design across all platforms, pass

<ion-content scrollbar allowAllScreens='true'>
   ...
</ion-content>

Further help

To get more help please pose your question on forum or mail at [email protected].