Socket
Socket
Sign inDemoInstall

@atlaskit/tokens

Package Overview
Dependencies
42
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @atlaskit/tokens

Design tokens are the single source of truth to name and store design decisions.


Version published
Weekly downloads
205K
decreased by-13.71%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Tokens

Tokens are a single source of truth to name and store Atlassian design decisions.

Installation

yarn add @atlaskit/tokens

Usage

View documentation.

BabelPlugin

A babel plugin to optimise performance and support fallbacks for Design System tokens.

It replaces any calls to the @atlaskit/tokens token() function with the CSS value the function would return (i.e. var(--token-name) or variations with fallbacks).

If there’s no fallback, the plugin (optionally) finds the token’s value from the default Atlassian theme, and sets it as the fallback.

If there is a fallback defined in code, it’s inserted into the style (expressions are inserted using template strings).

Usage

Add the plugin to your babel configuration:

{
  "plugins": ["@atlaskit/tokens/babel-plugin"]
}

Options

Currently the plugin supports one option, shouldUseAutoFallback. When enabled, the plugin will fetch the token's value in the default Atlassian theme (currently atlassian-light) and use it as the fallback value.

This is useful for cases where tokens are in use, but token definitions aren't present in the top-level page CSS.

FAQs

Last updated on 30 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc