You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@netlify/netlify-design-tokens

Package Overview
Dependencies
Maintainers
18
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/netlify-design-tokens

Netlify's design tokens for sharing across products and repos

6.0.0-rc.3
next
Source
npmnpm
Version published
Weekly downloads
74K
-5.31%
Maintainers
18
Weekly downloads
 
Created
Source

Netlify Design Tokens NPM version

Usage

Install the package in the project of your choice:

yarn add -D @netlify/netlify-design-tokens

From there, you may import any of the dist files into your codebase for reuse as desired:

CSS

Basic usage:

@import '@netlify/netlify-design-tokens/dist/css/color.css';

.myComponent {
  color: var(--colorFacetsTeal200);
}

Global dark mode support:

@import '@netlify/netlify-design-tokens/dist/css/color.css';

:root {
  --colorTeal: var(--colorFacetsTeal200);
}

@media (prefers-color-scheme: dark) {
  :root {
    --colorTeal: var(--colorFacetsTeal500);
  }
}

.myComponent {
  color: var(--colorTeal);
}

Alternatively, use the rgb(<color> / <alpha>) notation to vary color opacity:

@import '@netlify/netlify-design-tokens/dist/css/color.rgb.css';

:root {
  --colorTeal: var(--colorRgbFacetsTeal200);
}

@media (prefers-color-scheme: dark) {
  :root {
    --colorTeal: var(--colorRgbFacetsTeal200);
  }
}

.myComponent {
  color: rgb(var(--colorTeal) / 50%);
}

JavaScript

import { colorFacetsTeal500 } from '@netlify/netlify-design-tokens';

const teal = colorFacetsTeal500;

or:

import * as tokens from '@netlify/netlify-design-tokens';

const teal = tokens.colorFacetsTeal500;
const boldText = tokens.typographyWeightBold;

FAQs

Package last updated on 03 Nov 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.