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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thatch-health/slab-tokens

v0.0.3

Published

Generated CSS files and code plugins for the Slab design system at thatch.

Readme

Slab Tokens

This package is the pipeline for importing Figma tokens defined in Token Foundations and then outputing in appropriate formats for web, the marketing website, and slab design system itself. This package uses Terrazzo to manage the conversion from the Design Token Community Group specification which is a universal token specification. The package itself exports a few endpoints for consumers to use:

  • @thatch-health/slab-tokens/tokens-raw - The raw JSON values of the DTCG specification downloaded from Figma
  • @thatch-health/slab-tokens/css - The output from terrazzo using the css plugin
  • @thatch-health/slab-tokens/tailwind-v3-plugin - A plugin for tailwind v3 that maps css variables

Development

  • Install dependencies:
vp install
  • Build the library:
vp pack

Figma Conversion

While Figma does export tokens in a DTCG format it does not do appropriate unit conversions for tokens like using rem and px for certain spacing tokens. The way the conversion works is looking at the tokens $.extensions.['com.figma.scopes'] value in order to see what the usages are. Rather than always using rem units, we map tokens to the appropriate unit based on the use case. Token mappings are as follows:

| Figma Scope | Unit type | | ------------- | --------- | | CORNER_RADIUS | px | | GAP | px | | STROKE_FLOAT | px | | WIDTH_HEIGHT | rem |

All color tokens use the srgb color space

Typography tokens need to be merged into a typography DTCG $type. This can be done by collapsing typography types from type.tokens.json where the structure is Display.Large.Size to display.large with the following mapping of units:

| Figma Scope | Unit type | DTCG type | | -------------- | --------- | ------------- | | FONT_SIZE | rem | fontSize | | FONT_FAMILY | string | fontFamily | | FONT_STYLE | number | fontWeight | | LINE_HEIGHT | number | lineHeight | | LETTER_SPACING | rem | letterSpacing |

Note: In Figma, variable line height is represented in figma as a pixel unit, therefore, line height is converted to a percentage value of the typeography style's font size.

Importing tokens from Figma

Importing tokens from Figma is currently a manual process. In order to import tokens, you need to right click each collection and press export. Tokens are then placed into this file structure:

tokens-raw-import/
├── color/
│   └── [mode].tokens.json
├── color-core.tokens.json
├── color-primitives.tokens.json
├── spacing.tokens.json
├── spacing-primitives.tokens.json
├── type.tokens.json
└── type-primitives/
    └── [mode].tokens.json

When extracting tokens, you will have to format the tokens as they're exported which means that files will be downloaded as the collection name and then you'll need to rename the extracted json file to match the token name.

Collection with only one mode

  1. Download file from figma by right clicking and selecting "Export modes"
  2. Unzip directory
  3. Rename the extracted file, default.tokens.json, to [collection name in kebab case].tokens.json

Collection with many modes

  1. Download file from figma by right clicking and selecting "Export modes"
  2. Unzip directory
  3. Rename the directory file to kebab case, all files nested should already be in the correct format.

Further reading

Our docs

External docs