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

@animaapp/design-tokens-validator

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@animaapp/design-tokens-validator

Design tokens are becoming more commonplace as a tool to help provide a consistent way of managing design system attributes.

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-94.59%
Maintainers
7
Weekly downloads
 
Created
Source

Design Tokens Validator

Design tokens are becoming more commonplace as a tool to help provide a consistent way of managing design system attributes.

As the number of tools that include design token support increases, so does the importance of ensuring that your design tokens adhere to the Design Tokens Standard.

By having tokens that conform to this standard, you ensure that your tokens will be interoperable across a suite of different design system management platforms, like Anima.

Getting Started

If you want to validate your tokens online, try out our free online tool: ...

If you want to run this locally then:

  1. Install the package in your project:
npm i @animaapp/design-tokens-validator
  1. Import validate into your file:
import { validate } from "@animaapp/design-tokens-validator";
  1. Pass through your design tokens as a JavaScript object
const tokens = {
  brand: {
    $description: "Design tokens from our brand guidelines",
    color: {
      $description: "Our brand's primary color palette",
      acid green: {
        $value: "#00ff66"
      },
      hot pink: {
        $value: "#dd22cc"
      }
    }
  }
}

const errors = validate(tokens)
  1. Print out your errors to the console:
console.log(errors);

Automate your entire design system workflow

TODO

Additional Features

  • Handle resolution of local design token file
  • Validate JSON file
  • Handle external resolution of a design token file
  • Include link to relevant location in the design system spec
  • Add severity to messages (ERROR + WARN)

Improvements

  • Move messages over to the messages object. Use string interpolation to add the useful information to the message
  • Don't return early when the validator finds an error, as we can spot many errors in one pass

Future ideas

  • Support as a VSCode extension

FAQs

Package last updated on 12 Jun 2023

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