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

@bcredi/design-tokens

v1.0.3

Published

Design tokens for building Bcredi Design System UI

Downloads

22

Readme

@bcredi/design-tokens

The tokens used to build our components and our pages.

Overview

| Package | Version | | ------------------------- | ------- | | @bcredi/design-tokens | npm version |

Usage

The available tokens are for:

  • colors: Color pallete
  • fonts: Custom fonts and typographic scale
  • models: Box-model rules (z-index)
  • screens: Grid definitions (viewports, gutters and containers)

To install it in your project, run:

npm i --save @bcredi/design-tokens
# or yarn add @bcredi/design-tokens

After installing it, you'll be able to use it in two different ways:

SCSS

To use it in your Sass stylesheets, import the source file using:

@import '[node_modules path]/@bcredi/design-tokens/dist/[token_file].scss';

PostCSS

To use it in your PostCSS pipe, follow the postcss-map plugin usage with the custom yml files in the options object:

const path = require('path');
const postcss = require('postcss');
const map = require('postcss-map');

const mapsDir = path.join(__dirname, 'node_modules/@bcredi/design-tokens/dist');

const opts = {
  basePath: 'css',
  maps: [`${mapsDir}/[token_file].yml`],
};

postcss()
  .use(map(opts))
  .process(YOUR_CSS_FILE.css)
  .then(result => {
    fs.writeFileSync('output.css', result.css);
  });

JavaScript

You can use the tokens as .js or as .json files:

CommonJS

To use the tokens with default CommonJS:

// js files
const tokenFile = require('@bcredi/design-tokens/dist/[token_file].js');

// json files
const tokenFile = require('@bcredi/design-tokens/dist/[token_file].json');

ES6 Modules

To use the tokens with ES6 Modules:

// js files
import tokens from '@bcredi/design-tokens/dist/[token_file].js';

// json files
import '@bcredi/design-tokens/dist/[token_file].json';
If you have an import resolver, ignore the [node_modules path]
Replace [token_file] with the names from the list above

What's included

  • Color palette
  • Font-families, font-weights and typographic scale definitions
  • Screens sizes and grid breakpoints
  • Z-index cascades scheme