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

flavour

v0.2.3

Published

Sass-powered flavour picker for simple live recoloration

Downloads

3

Readme

Flavour

Pre-made SASS stylesheet & JQuery event handler for live recoloration

See it working at http://nicolasthebaud.github.io/Flavour/

Install

$ npm install flavour

Features

Flavour has 5 colors set up by default

Usage

Once installed, open you HTML file (or React component or whatever) :

<div flavour=1>
  <button class="flavour-setup" flavour=1>
  <p flavour-text=1>Lorem ipsum</p>
</div>

As simple as that !

• Every element that has a flavour attribute will have its background-color flavoured

• Every element that has a flavour-text attribute will have its color flavoured

NOTE: Element with the flavour-setup class are triggers, they dynamically set the page's flavour

For dummies

If you (still) don't get it, read this:

Flavour is just a pretty name I came up with to describe Colors

The point of this module is to allow you to add instant recoloration tools to your page,

like the night mode on twitch, for example

This is done by throwing a bunch of custom attributes in your HTML and handling them for you.

All you have to do is nothing, except maybe...

Configuration

(talk about transitions...)

Flavour offers you two ways of configuring your app

The Sass way

Flavour works with Sass files

If you know Sass stylesheets and are capable of writing some yourself, this is a good alternative

$ flavour myself [ -o <directory> ]

"woah it even comes with a CLI"

That's right

This command will clone an example file in "css/flavours.scss" by default, or in the directory specified by the -o option

this file contains a little tutorial on how to setup a new flavour, along with an exmaple (that you can delete if you wish)

The command-line way

If you are lazy, or just don't know Sass, you can still use commands to configure Flavour

$ flavour add <hexColor> [-n <name> ]

Basically self-explanatory. Adds a new flavour to the registry

hexColor a String, representing the color to be added

  • I trust you to add a valid Hex code (ex: fff or aa0031, not xx32ml). If you don't, it will still be added to the registry, but it won't work (duh)

  • -n to name the color. If not specified, the color's name will be an integer, starting from 6 (because 5 native flavours), and incrementing. You can't add a color if the specified name already exists in the registry, otherwise it would mess up the Sass...

By the way, Registry ? what is this ?

$ flavour ls|list

Once again, this one speaks for itself. This will list the colors in the registry, like so

$color1: #fff;
$color2: #eee;
...

And finally,

$ flavour del|delete <name>

Delete a color. Your color. you can't remove mine, the 5 firsts