Soracom

Design System
  1. Home
  2. Design system
  3. Design tokens

Design tokens

Available SDS design tokens and their CSS custom properties.

Overview

SDS design tokens are published as JSON using the W3C Design Tokens Community Group format, and as generated artifacts for common browser and JavaScript use cases.

File URL
Token source https://assets.soracom.io/sds/latest/tokens.json
CSS custom properties https://assets.soracom.io/sds/latest/tokens.css
JavaScript module https://assets.soracom.io/sds/latest/tokens.mjs
TypeScript declarations https://assets.soracom.io/sds/latest/tokens.d.ts

The token JSON is the source of truth for generating platform-specific outputs such as CSS, Sass, React theme objects, Tailwind configuration, or design tool imports.

The generated files expose the same token set in ready-to-use formats.

Use case Recommended source
Styling app UI with SDS variables tokens.css
Consuming tokens in JavaScript, React, or chart config tokens.mjs
Type checking the JavaScript token module tokens.d.ts
Generating custom framework themes, static constants, or platform-specific assets tokens.json
Reading color data in JavaScript charts ds-color/index.mjs

CSS variables

Use tokens.css when a project needs SDS CSS custom properties but does not need the full SDS component styles.

<link rel="stylesheet" href="https://assets.soracom.io/sds/latest/tokens.css" />

Use CSS custom properties instead of hard-coded values when building or extending SDS components.

.custom-panel {
  padding: var(--space-small);
  color: var(--color-default);
  font-family: var(--ds-font-default);
  font-size: var(--ds-text-size-medium);
  background-color: var(--color-background);
}

Prefer semantic color tokens such as --color-default, --color-background, --color-alert, and --color-link before selecting a palette token such as --color-red-600.

JavaScript tokens

Use tokens.mjs when consuming SDS tokens from JavaScript, React, chart configuration, or build tooling.

The module exports:

Export Use
sdsTokens Token values as CSS variable references, such as var(--color-default)
sdsTokenValues Resolved token values, such as 20px or oklch(...)
default Same value as sdsTokens

Use sdsTokens for browser-rendered UI so theme-aware tokens and dark mode continue to resolve through CSS.

import { sdsTokens } from "https://assets.soracom.io/sds/latest/tokens.mjs";

export function Panel({ children }: { children: React.ReactNode }) {
  return (
    <section
      style={{
        padding: sdsTokens.space.small,
        color: sdsTokens.color.default,
        fontSize: sdsTokens.textSize.medium,
        backgroundColor: sdsTokens.color.background,
      }}
    >
      {children}
    </section>
  );
}

Use sdsTokenValues when a build tool needs final values instead of CSS variable references.

import { sdsTokenValues } from "https://assets.soracom.io/sds/latest/tokens.mjs";

export default {
  theme: {
    extend: {
      spacing: {
        small: sdsTokenValues.space.small,
      },
    },
  },
};

When using sdsTokens, load tokens.css or the full SDS stylesheet before rendering components that consume those CSS variable references.

Source JSON

Use the published tokens.json directly when generating output for another system. Each token entry includes a DTCG token path, $type, $value, and SDS extension metadata.

{
  "space": {
    "$type": "dimension",
    "small": {
      "$value": "20px",
      "$extensions": {
        "com.soracom.sds": {
          "cssVariable": "--space-small"
        }
      }
    }
  }
}

For this token:

Field Value
Token path space.small
Token type dimension
Token value 20px
CSS variable --space-small
const response = await fetch("https://assets.soracom.io/sds/latest/tokens.json");
const tokens = await response.json();

const token = tokens.space.small;

console.log(token.$value); // "20px"
console.log(token.$extensions["com.soracom.sds"].cssVariable); // "--space-small"

Token values may be literal values, CSS expressions, or references to other tokens using DTCG reference syntax such as {color.red} or {text-size.2xsmall}. Resolve references in your token pipeline before emitting formats that require final values.

Use the SDS extension metadata when generating named outputs:

Extension field Use
cssVariable Public CSS custom property name
scssVariable Public Sass variable name

Color tokens

Color tokens are available as CSS variables with the --color-* prefix.

Palette families

The available color families are:

Family Base token
Red --color-red
Blue --color-blue
Celeste --color-celeste
Ink --color-ink
Gray --color-gray
Mauve --color-mauve
Green --color-green
Yellow --color-yellow
Purple --color-purple
Orange --color-orange
Magenta --color-magenta

Each family has fixed numbered tokens and theme-aware named tokens.

Token style Available suffixes Example
Fixed numbered tokens 950, 900, 800, 700, 600, 400, 300, 200, 100, 50 --color-celeste-600
Theme-aware named tokens dim, dark, darker, darkest, shade, tint, light, lighter, lightest, bright --color-celeste-shade

Fixed numbered tokens keep the same value in light and dark themes. Theme-aware named tokens use light-dark() and automatically map to an appropriate light or dark value.

Semantic color tokens

Use semantic color tokens when the color has a known purpose.

Token Use
--color-default Default text and foreground color
--color-default-shade Stronger default foreground color
--color-default-tint Tinted default foreground color
--color-default-light Muted default foreground color
--color-default-lighter More muted default foreground color
--color-default-lightest Most muted default foreground color
--color-background Default page or surface background
--color-background-shade Subtle background shade
--color-background-dark Stronger background shade
--color-background-darker High-emphasis background shade
--color-background-darkest Highest-emphasis background shade
--color-alert Error, destructive, or alert state
--color-warning Warning or caution state
--color-success Success or positive state
--color-info Informational state
--color-mute Muted or de-emphasized UI
--color-highlight SDS accent highlight
--color-link Links
--color-focus Focus outline color
--color-shadow-light Light shadow color
--color-shadow Default shadow color
--color-shadow-dark Strong shadow color
--color-transparent Transparent color
--color-black Black
--color-white White
--color-dark-dark Dark contrast helper
--color-dark-light Theme-aware dark contrast helper
--color-light-light Light contrast helper
--color-light-dark Theme-aware light contrast helper

For visual swatches and accessibility guidance, see Colors.

Space tokens

Use space tokens for gaps, padding, margins, and layout rhythm.

Token CSS variable Default value Small-screen value
space.2xlarge --space-2xlarge 80px 60px
space.xlarge --space-xlarge 60px 40px
space.mlarge --space-mlarge 50px 35px
space.large --space-large 40px 30px
space.medium --space-medium 30px 20px
space.small --space-small 20px 10px
space.xsmall --space-xsmall 10px 7px
space.2xsmall --space-2xsmall 5px 3px

Small-screen values apply at max-width: 599px.

Text size tokens

Text size tokens define the available SDS text sizes.

Token CSS variable Value
text-size.4xsmall --ds-text-size-4xsmall .8rem
text-size.3xsmall --ds-text-size-3xsmall .9rem
text-size.2xsmall --ds-text-size-2xsmall 1rem
text-size.xsmall --ds-text-size-xsmall 1.1rem
text-size.small --ds-text-size-small 1.2rem
text-size.medium --ds-text-size-medium 1.3rem
text-size.large --ds-text-size-large 1.5rem
text-size.xlarge --ds-text-size-xlarge 1.8rem
text-size.2xlarge --ds-text-size-2xlarge 2.2rem
text-size.3xlarge --ds-text-size-3xlarge 2.8rem
text-size.4xlarge --ds-text-size-4xlarge 3.6rem
text-size.huge --ds-text-size-huge 4.6rem
text-size.xhuge --ds-text-size-xhuge 5.8rem
text-size.2xhuge --ds-text-size-2xhuge 7.2rem
text-size.3xhuge --ds-text-size-3xhuge 8.8rem
text-size.4xhuge --ds-text-size-4xhuge 10.6rem
text-size.xxsmall --ds-text-size-xxsmall var(--ds-text-size-2xsmall)
text-size.xxlarge --ds-text-size-xxlarge var(--ds-text-size-2xlarge)
text-size.xxhuge --ds-text-size-xxhuge var(--ds-text-size-2xhuge)

Icon size tokens

Icon size tokens define the available SDS icon sizes.

Token CSS variable Value
icon-size.4xsmall --ds-icon-size-4xsmall 1.2rem
icon-size.3xsmall --ds-icon-size-3xsmall 1.3rem
icon-size.2xsmall --ds-icon-size-2xsmall 1.5rem
icon-size.xsmall --ds-icon-size-xsmall 1.8rem
icon-size.small --ds-icon-size-small 2.2rem
icon-size.medium --ds-icon-size-medium 2.8rem
icon-size.large --ds-icon-size-large 3.6rem
icon-size.xlarge --ds-icon-size-xlarge 4.6rem
icon-size.2xlarge --ds-icon-size-2xlarge 5.8rem
icon-size.3xlarge --ds-icon-size-3xlarge 7.2rem
icon-size.4xlarge --ds-icon-size-4xlarge 8.8rem
icon-size.huge --ds-icon-size-huge 10.6rem
icon-size.xhuge --ds-icon-size-xhuge 12.6rem
icon-size.2xhuge --ds-icon-size-2xhuge 14.8rem
icon-size.3xhuge --ds-icon-size-3xhuge 17.2rem
icon-size.4xhuge --ds-icon-size-4xhuge 19.8rem
icon-size.xxtiny --ds-icon-size-xxtiny var(--ds-icon-size-3xsmall)
icon-size.xtiny --ds-icon-size-xtiny var(--ds-icon-size-2xsmall)
icon-size.tiny --ds-icon-size-tiny var(--ds-icon-size-xsmall)
icon-size.xxsmall --ds-icon-size-xxsmall var(--ds-icon-size-2xsmall)
icon-size.xxlarge --ds-icon-size-xxlarge var(--ds-icon-size-2xlarge)
icon-size.xxhuge --ds-icon-size-xxhuge var(--ds-icon-size-2xhuge)
icon-size.massive --ds-icon-size-massive var(--ds-icon-size-3xhuge)
icon-size.xmassive --ds-icon-size-xmassive var(--ds-icon-size-4xhuge)
icon-size.xxmassive --ds-icon-size-xxmassive 22.6rem

Font tokens

Font tokens are available for font families and font weights.

Token CSS variable Value
font.family.default --ds-font-default "Source Han Sans JP", "Arial", "Helvetica", sans-serif
font.family.heading --ds-font-heading "Aeonik", "Source Han Sans JP", "Arial", "Helvetica", sans-serif
font.family.mono --ds-font-mono "Source Code", monospace
font.weight.light --ds-font-weight-light 280
font.weight.normal --ds-font-weight-normal 420
font.weight.bold --ds-font-weight-bold 820

Opacity tokens

Opacity tokens are used by SDS to mix colors and represent common opacity levels.

Token CSS variable Value
opacity.normal --ds-normal 100%
opacity.tint --ds-tint 77%
opacity.light --ds-light 52%
opacity.lighter --ds-lighter 29%
opacity.lightest --ds-lightest 15%
opacity.bright --ds-bright 6.25%
opacity.disabled --ds-disabled-opacity 30%