Soracom

Design System
  1. Home
  2. Design system
  3. Guidelines
  4. 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.

FileURL
Token sourcehttps://assets.soracom.io/sds/latest/tokens.json
CSS custom propertieshttps://assets.soracom.io/sds/latest/tokens.css
JavaScript modulehttps://assets.soracom.io/sds/latest/tokens.mjs
TypeScript declarationshttps://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 caseRecommended source
Styling app UI with SDS variablestokens.css
Consuming tokens in JavaScript, React, or chart configtokens.mjs
Type checking the JavaScript token moduletokens.d.ts
Generating custom framework themes, static constants, or platform-specific assetstokens.json
Reading color data in JavaScript chartsds-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(--ds-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:

ExportUse
sdsTokensToken values as CSS variable references, such as var(--color-default)
sdsTokenValuesResolved token values, such as 20px or oklch(...)
defaultSame 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": "--ds-space-small"
        }
      }
    }
  }
}

For this token:

FieldValue
Token pathspace.small
Token typedimension
Token value20px
CSS variable--ds-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); // "--ds-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 fieldUse
cssVariablePublic CSS custom property name
scssVariablePublic Sass variable name

Color tokens

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

Palette families

The available color families are:

FamilyBase 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 styleAvailable suffixesExample
Fixed numbered tokens950, 900, 800, 700, 600, 400, 300, 200, 100, 50--color-celeste-600
Theme-aware named tokensdim, 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.

TokenUse
--color-defaultDefault text and foreground color
--color-default-shadeStronger default foreground color
--color-default-tintTinted default foreground color
--color-default-lightMuted default foreground color
--color-default-lighterMore muted default foreground color
--color-default-lightestMost muted default foreground color
--color-backgroundDefault page or surface background
--color-background-shadeSubtle background shade
--color-background-darkStronger background shade
--color-background-darkerHigh-emphasis background shade
--color-background-darkestHighest-emphasis background shade
--color-alertError, destructive, or alert state
--color-warningWarning or caution state
--color-successSuccess or positive state
--color-infoInformational state
--color-muteMuted or de-emphasized UI
--color-highlightSDS accent highlight
--color-linkLinks
--color-focusFocus outline color
--color-shadow-lightLight shadow color
--color-shadowDefault shadow color
--color-shadow-darkStrong shadow color
--color-transparentTransparent color
--color-blackBlack
--color-whiteWhite
--color-dark-darkDark contrast helper
--color-dark-lightTheme-aware dark contrast helper
--color-light-lightLight contrast helper
--color-light-darkTheme-aware light contrast helper

For visual swatches and accessibility guidance, see Colors.

Space tokens

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

TokenCSS variableDefault valueSmall-screen value
space.xxlarge--ds-space-xxlarge80px60px
space.xlarge--ds-space-xlarge60px40px
space.mlarge--ds-space-mlarge50px35px
space.large--ds-space-large40px30px
space.medium--ds-space-medium30px20px
space.small--ds-space-small20px10px
space.xsmall--ds-space-xsmall10px7px
space.xxsmall--ds-space-xxsmall5px3px

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

Text size tokens

Text size tokens define the available SDS text sizes.

TokenCSS variableValue
text-size.4xsmall--ds-text-size-4xsmall.8rem
text-size.3xsmall--ds-text-size-3xsmall.9rem
text-size.2xsmall--ds-text-size-2xsmall1rem
text-size.xsmall--ds-text-size-xsmall1.1rem
text-size.small--ds-text-size-small1.2rem
text-size.medium--ds-text-size-medium1.3rem
text-size.large--ds-text-size-large1.5rem
text-size.xlarge--ds-text-size-xlarge1.8rem
text-size.2xlarge--ds-text-size-2xlarge2.2rem
text-size.3xlarge--ds-text-size-3xlarge2.8rem
text-size.4xlarge--ds-text-size-4xlarge3.6rem
text-size.huge--ds-text-size-huge4.6rem
text-size.xhuge--ds-text-size-xhuge5.8rem
text-size.2xhuge--ds-text-size-2xhuge7.2rem
text-size.3xhuge--ds-text-size-3xhuge8.8rem
text-size.4xhuge--ds-text-size-4xhuge10.6rem
text-size.xxsmall--ds-text-size-xxsmallvar(--ds-text-size-2xsmall)
text-size.xxlarge--ds-text-size-xxlargevar(--ds-text-size-2xlarge)
text-size.xxhuge--ds-text-size-xxhugevar(--ds-text-size-2xhuge)

Icon size tokens

Icon size tokens define the available SDS icon sizes.

TokenCSS variableValue
icon-size.4xsmall--ds-icon-size-4xsmall1.2rem
icon-size.3xsmall--ds-icon-size-3xsmall1.3rem
icon-size.2xsmall--ds-icon-size-2xsmall1.5rem
icon-size.xsmall--ds-icon-size-xsmall1.8rem
icon-size.small--ds-icon-size-small2.2rem
icon-size.medium--ds-icon-size-medium2.8rem
icon-size.large--ds-icon-size-large3.6rem
icon-size.xlarge--ds-icon-size-xlarge4.6rem
icon-size.2xlarge--ds-icon-size-2xlarge5.8rem
icon-size.3xlarge--ds-icon-size-3xlarge7.2rem
icon-size.4xlarge--ds-icon-size-4xlarge8.8rem
icon-size.huge--ds-icon-size-huge10.6rem
icon-size.xhuge--ds-icon-size-xhuge12.6rem
icon-size.2xhuge--ds-icon-size-2xhuge14.8rem
icon-size.3xhuge--ds-icon-size-3xhuge17.2rem
icon-size.4xhuge--ds-icon-size-4xhuge19.8rem
icon-size.xxtiny--ds-icon-size-xxtinyvar(--ds-icon-size-3xsmall)
icon-size.xtiny--ds-icon-size-xtinyvar(--ds-icon-size-2xsmall)
icon-size.tiny--ds-icon-size-tinyvar(--ds-icon-size-xsmall)
icon-size.xxsmall--ds-icon-size-xxsmallvar(--ds-icon-size-2xsmall)
icon-size.xxlarge--ds-icon-size-xxlargevar(--ds-icon-size-2xlarge)
icon-size.xxhuge--ds-icon-size-xxhugevar(--ds-icon-size-2xhuge)
icon-size.massive--ds-icon-size-massivevar(--ds-icon-size-3xhuge)
icon-size.xmassive--ds-icon-size-xmassivevar(--ds-icon-size-4xhuge)
icon-size.xxmassive--ds-icon-size-xxmassive22.6rem

Font tokens

Font tokens are available for font families and font weights.

TokenCSS variableValue
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-light280
font.weight.normal--ds-font-weight-normal420
font.weight.bold--ds-font-weight-bold820

Opacity tokens

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

TokenCSS variableValue
opacity.normal--ds-normal100%
opacity.tint--ds-tint77%
opacity.light--ds-light52%
opacity.lighter--ds-lighter29%
opacity.lightest--ds-lightest15%
opacity.bright--ds-bright6.25%
opacity.disabled--ds-disabled-opacity30%