Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tokens-studio/types

Package Overview
Dependencies
Maintainers
5
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokens-studio/types

![NPM version badge](https://img.shields.io/npm/v/@tokens-studio/types) ![License badge](https://img.shields.io/github/license/tokens-studio/types)

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Tokens Studio Types

NPM version badge License badge

This repository is a collection of type definitions relating to Tokens Studio.

It currently exports types for all the available types of Design Tokens, as they exist in the Tokens Studio Figma Plugin. It also includes some type definitions for things like the $themes.json schema, HSLA/RGBA values, color modifier options and composition tokens.

Installation

With NPM:

npm install @tokens-studio/types

Documentation

See our documentation site here

Usage

import { SingleTypographyToken } from '@tokens-studio/types';

function logTypographyToken(token: SingleTypographyToken) {
  // because token is properly typed, we get autocomplete
  // e.g. token.type will be typed as "typography"
  const { value } = token;
  if (typeof value === 'string') {
    console.log(value);
  } else {
    // due to proper type, we get these properties autosuggested properly
    console.log(`${value.fontWeight} ${value.fontSize}/${value.lineHeight} ${value.fontFamily}`);
  }
}

Keywords

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc