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

kobalt

v1.1.0-alpha.16

Published

A cli to generate a theme from figma projects.

Downloads

41

Readme

important

This is still in early development

getting started

npm i kobalt

add a npm script to generate components

"scripts": {
  "generate": "kobalt",
  ...
}

configure your access token for the figma api here first. Create a .env file with your configuration (don't include the file extension with the filename).

Inside figma, create a page to define a theme and add three frames, one for colors, one for fonts and one for spacing. The structure of the elements inside these frames determine how your variables and components are named.

e.g. colors > base > primary or fonts > base > paragraph. Where colors or fonts is the name of the frame, base is the name of a group and primary is a rectangle with a color variable assigned to it and paragraph is a text element. If the color assigned to the font is a color from the colors frame, kobalt can infer the reference and use the generated theme. The spacing frame should contain a list of rectangles where the width of the rectangle determines what gets generated.

FIGMA_ACCESS_TOKEN=<access-token>
FIGMA_PROJECT_ID=<project-id>
FIGMA_STYLE_PAGE=<pagename>
FIGMA_COLOR_FRAME=<framename>
FIGMA_FONT_FRAME=<framename>
FIGMA_SPACING_FRAME=<framename>
OUTPUT_FILE=<filename>
OUTPUT_FOLDER=<foldername>

generate components

npm run generate

add the generated declaration file for the styled-components theme to the include property in tsconfig.json

{
  "include": ["theme.d.ts", ...],
}

import the GeneratedTheme component together with the components themeselves

import { GeneratedTheme, ... } from '../<foldername>/<filename>';