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

@transferwise/neptune-tokens

Package Overview
Dependencies
Maintainers
300
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@transferwise/neptune-tokens

Design tokens for the Neptune Design System

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
168
increased by35.48%
Maintainers
300
Weekly downloads
 
Created
Source

Neptune Tokens npm

Design tokens for the Neptune Design System. Includes spacing and colours, and distributes bundles for common formats.

Tokens always start with a base layer that directly accesses the values, and can be extended with a semantic layer that describes the token's intended purpose, rather than how it looks.

Getting started

For npm environments, install the package and consume the bundled files described below.

npm i @transferwise/neptune-tokens

Spacing

We use a 4-point scale that gives finer control to align elements inside components and optimise space on smaller screens, and from 16 onwards it becomes an 8-point scale where the difference in steps is more visible. There's currently no semantic layer for spacing.

NameSize
space-44
space-88
space-1212
space-1616
space-2424
space-3232
space-4040
space-4848

Web

// CSS custom properties
@import "@transferwise/neptune-tokens/spacing.css";

.tw-checkable-card {
  padding: var(--space-16);
}
// Less variables
@import "@transferwise/neptune-tokens/spacing.less";

.tw-checkable-card {
  padding: @space-16;
}

Colours

Our current colour palette is built on a main set of 7 base colours with different levels of brightness. From lightest to darkest:

  • Fade
  • Light
  • Mid
  • Dark

The base set also includes 3 brand colours, currently used exclusively in marketing pages outside product, that don't have brightness variations.

We have 2 themes, light and dark, that refer to the colours semantically. This is the recommended way of using our colour tokens, as the base colours have a higher risk of deprecation. There are no dependencies between the imports, the values are flattened on the themes, so base colours don't usually need to be imported.

Source values

Web

We currently only have one theme on web, so colors.css directly references the values from the light theme.

// CSS custom properties
@import "@transferwise/neptune-tokens/colors.css";

.button {
  background-color: var(--color-control-accent);
}

The base colours are currently only bundled in Less.

// Less variables
@import "@transferwise/neptune-tokens/colors-base.less";

.special-brand-element {
  background-color: @color-base-brand-purple;
}

iOS

We generate 2 asset catalogs for iOS:

  • BaseColors.xcassets contains the base colours
  • Colors.xcassets contains the semantic colours with the light and dark themes associated with iOS appearances

To use them, copy both catalogs on the dist folder to your iOS project.

Figma

To import or update colours on the Figma libraries for Neptune:

  1. Copy the values from the colors.json file in the dist folder
  2. Paste them into the plugin Import from Style Dictionary

FAQs

Package last updated on 04 Jun 2020

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