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

@abw/badger-color

v0.0.10

Published

Color Palette Designer

Downloads

15

Readme

badger-color

This is a collection of tools including an online editor for designing color palettes and exporting them as CSS and/or SCSS variables.

The palette editor is available here: https://abw.github.io/badger-color

This is a work-in-progress in a pre-release state.

Installation

Add the @abw/badger-color module to your project using your favourite package manager. Unless you're planning on running the online editor it should be sufficient to add it as a dev dependency.

## using npm
$ npm add -D @abw/badger-color

## using yarn
$ yarn add -D @abw/badger-color

## using pnpm
$ pnpm add -D @abw/badger-color

Design a Palette

Use the online palette editor to design a color palette.

Click on the download button to download the palette data as a JSON file. Save this to your project somewhere.

Export Palette Data

Run the following command to export the palette data as SCSS files containing SCSS variables and CSS custom properties for each of the color ranges in your palette.

$ npm badger-color-scss

It will prompt you to enter the path to your palette JSON file and an output directory for the generated files.

✔ Where is the palette data file? … path/to/palette.json
✔ Where should the output files be written? … styles

You can also provide command line options to avoid the questions. Use the -h or --help option to see a summary of the options. A typical invocation will look like this:

$ npm badger-color-scss -p path/to/palette.json -o outdir -y -q

The script will generate a colors.scss file in the output directory and separate files in the color sub-directory for each of the color ranges in your palette. The colors.scss will import each of the color range files.

Add Palette Data to Your Stylesheet

Import the generated colors.scss file into your main stylesheet SCSS file.

@import "path/to/colors.scss";

Then start using the colors. You can use the generated SCSS variables:

.example {
  color: $blue-50;
}

Or you can use the generated CSS custom properties:

.example {
  color: var(--blue-50);
}

Notes for Maintainers

Check out the repository.

$ git clone https://github.com/abw/badger-color.git
$ cd badger-color

Install the dependencies.

$ pnpm install

To run the development server.

$ pnpm dev

To run the tests.

$ pnpm test

To build for production.

$ pnpm build

To build the documentation.

$ pnpm build:docs

To preview the documentation.

$ pnpm preview

Check source code for formatting errors.

$ pnpm lint