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

cds-tokens

v0.1.1

Published

Design Tokens for Costco Design System

Downloads

3

Readme

Status

| Component | Status | |--------------|-----------------------| | Button | Complete | | Card | Complete | | Divider | Complete | | Input | Single input complete | | List | Complete | | Notification | Complete | | Typography | Complete |

Installation

CDS Design Tokens is available as a npm package on npm

To install the package locally using npm:

npm install cds-tokens

Usage

SCSS

Webpack

@import '~/cds-tokens/dist/scss/_cds-variables.scss';

Gulp.js

@import '~/cds-tokens/dist/scss/_cds-variables.scss';

In gulpfile.js

.pipe(sass({ includePaths: ['node_modules'] })

ES6 Modules

Importing all modules as single object

import * as tokens from 'cds-tokens/dist/js/cds-variables';

To use background: ${tokens.ColorBlue600};

Importing modules as individual objects import {ColorBlue600} from 'cds-tokens/dist/js/cds-variables';

Project Structure

/ contains style-dictionary build script and configs

/properties contains the design tokens input files (in JSON format)

/properties/base contains component agnostic tokens

/properties/components contains component tokens

dist/ contains the generated output files (in different formats)

Token Structure

| Key | Example Values | |-------------------|-----------------------------------------| | Attribute Type | color, font, space, size | | Attribute | icon, line-height, icon-svg, inset | | Attribute Variant | gray-500, md, bold, success | | Component | button, notification, typography, modal | | Component Variant | alert, primary, t1-desktop, general | | Component State | default, hover, active, focus |

Base Tokens

| Base Token | Key | |------------|--------| | Breakpoint | bp | | Color | color | | Font | font | | Grid | grid | | Radius | radius | | Size | Size | | Space | space | | Typography | type |

Attribute Type → Attribute → Attribute Variant

Component Tokens

Component → Attribute Type → Component Variant → Component State → Attribute

Contributing

Updating/Creating New Tokens

  1. Pull the latest master branch and create a new branch (TODO branch guidelines)
  2. Update or add new tokens using token structure
  3. Run npm run build to build tokens
  4. Use - Install Local or NPM Link to test current branch tokens in your project.
  5. When tokens are ready, follow Publishing to NPM section.

Versioning

This project's versioning specification is based off of Semantic Versioning (also known as semver)

  • Patch version (0.0.x) -> A patch version will be automatically released when tokens contain backwards-compatible changes. This means that for a specific design-system some values are corrected and updated (ie: a color get updated)
  • Minor version (0.x.0) -> A minor version will be automatically released when a new functionality is added in a backwards-compatible manner. This means that for a specific design-system you are adding new decisions (ie: a new color is added)
  • Major version (x.0.0) -> A major version will be automatically released when a breaking changes is identified. This means that for a specific design token some values where removed (ie: a color was removed)

Publishing to NPM

  1. Before you start make sure the project's CHANGELOG.MD is up to date. (TODO)
  2. Update the package version number in /package.json (use Semantic Versioning to determine what the new version number should be).
  3. Run npm install to update the package-lock.json file.
  4. Submit a pull request with your changes (or commit directly to master if you have permission). Once the changes have been merged to master.
  5. Run npm run test. If tests pass, continue to next step (TODO, can combine with build step).
  6. Run npm run build to run the build script (Style Dictionary)
  7. If the build is successful publish to NPM using npm publish.

References