Export formats

A live release as a file your codebase uses. The same formats are on Overview, in the CLI, the API and the MCP export_tokens tool.

Formats

  • CSS variables
    Id
    css
    File
    .css
    Covers
    A custom property for every token. Modes become attribute selectors, so one file covers them all.
  • CSS, light and dark
    Id
    css-auto
    File
    .auto.css
    Covers
    Light values in :root and dark values inside prefers-color-scheme: dark, so the page follows the device. data-theme="light" or "dark" on <html> overrides it.
  • JSON (W3C)
    Id
    json-dtcg
    File
    .tokens.json
    Covers
    Resolved tokens in the W3C 2025.10 format, for Style Dictionary v5 and other current tools. One mode per file.
  • JSON (Style Dictionary v4)
    Id
    json-sd4
    File
    .json
    Covers
    The same tokens with the older value format Style Dictionary v4 reads: hex colours, "16px", "200ms". One mode per file.
  • JavaScript
    Id
    js
    File
    .js
    Covers
    An ES module exporting a nested object of CSS-ready values. One mode per file.
  • TypeScript
    Id
    ts
    File
    .ts
    Covers
    The JavaScript module, typed with as const so values autocomplete. One mode per file.
  • SCSS
    Id
    scss
    File
    .scss
    Covers
    A Sass variable for every token, with CSS-ready values. One mode per file.
  • Tailwind config
    Id
    tailwind
    File
    .tailwind.config.js
    Covers
    A tailwind.config.js theme.extend with colors, spacing, fonts, shadows and easing. Works with Tailwind 3, and Tailwind 4 through @config. One mode per file.
  • Tailwind 4 theme
    Id
    tailwind4
    File
    .theme.css
    Covers
    A CSS file with an @theme block (--color-*, --spacing-*, --font-*, --shadow-*, --ease-*, --radius-*) for Tailwind 4. Import it after "tailwindcss". One mode per file.
  • Swift (SwiftUI)
    Id
    swift
    File
    .swift
    Covers
    A StoakenTokens enum with Color, CGFloat, Font.Weight and TimeInterval constants. One mode per file.
  • Jetpack Compose
    Id
    compose
    File
    .kt
    Covers
    A Kotlin StoakenTokens object with Color, Dp, FontWeight, TextStyle and easing values for Compose. One mode per file.
  • Android XML
    Id
    android
    File
    .xml
    Covers
    A values resource file with colors, dimens (dp), integers and strings. One mode per file, e.g. values/ and values-night/.
FormatIdFileCovers
CSS variablescss.cssA custom property for every token. Modes become attribute selectors, so one file covers them all.
CSS, light and darkcss-auto.auto.cssLight values in :root and dark values inside prefers-color-scheme: dark, so the page follows the device. data-theme="light" or "dark" on <html> overrides it.
JSON (W3C)json-dtcg.tokens.jsonResolved tokens in the W3C 2025.10 format, for Style Dictionary v5 and other current tools. One mode per file.
JSON (Style Dictionary v4)json-sd4.jsonThe same tokens with the older value format Style Dictionary v4 reads: hex colours, "16px", "200ms". One mode per file.
JavaScriptjs.jsAn ES module exporting a nested object of CSS-ready values. One mode per file.
TypeScriptts.tsThe JavaScript module, typed with as const so values autocomplete. One mode per file.
SCSSscss.scssA Sass variable for every token, with CSS-ready values. One mode per file.
Tailwind configtailwind.tailwind.config.jsA tailwind.config.js theme.extend with colors, spacing, fonts, shadows and easing. Works with Tailwind 3, and Tailwind 4 through @config. One mode per file.
Tailwind 4 themetailwind4.theme.cssA CSS file with an @theme block (--color-*, --spacing-*, --font-*, --shadow-*, --ease-*, --radius-*) for Tailwind 4. Import it after "tailwindcss". One mode per file.
Swift (SwiftUI)swift.swiftA StoakenTokens enum with Color, CGFloat, Font.Weight and TimeInterval constants. One mode per file.
Jetpack Composecompose.ktA Kotlin StoakenTokens object with Color, Dp, FontWeight, TextStyle and easing values for Compose. One mode per file.
Android XMLandroid.xmlA values resource file with colors, dimens (dp), integers and strings. One mode per file, e.g. values/ and values-night/.

Modes

CSS variables holds every mode combination in one file: the default in :root and each other mode as an attribute selector such as [data-color-scheme="dark"]. CSS, light and dark follows the device instead, with data-theme to override. Every other format writes one mode per file: pass --mode (CLI) or ?mode= (API), for example one Swift file per mode or values/ and values-night/ on Android.

What gets left out

Each platform can hold some token types and not others (Android resources have no shadows, for instance). Anything left out is listed in a Notes comment at the top of the file and in the Stoaken-Export-Warnings header, so nothing disappears silently. Text sizes, line heights and letter spacing are in sp on Android and Compose (so they follow the person's text-size setting); every other dimension is in dp.

How each format is tested

Every format is put to work on every change, the way a team would use it, not just checked for text:

  • CSS variables
    What the test does
    Parsed by a real CSS parser, then applied in a browser: a button reads its colour and padding from the file, in the default mode and after switching to dark the way the file says.
  • CSS, light and dark
    What the test does
    Applied in a browser set to light, then dark: the page follows the device by itself.
  • Tailwind 4
    What the test does
    Tailwind v4 builds utilities from the theme file (bg-brand-primary, p-md) and a browser paints them with the right values.
  • Tailwind 3
    What the test does
    Loaded as the config of a real Tailwind v3 build, which generates the utilities.
  • SCSS
    What the test does
    Compiled with Dart Sass; the variables come out as the values.
  • JavaScript, TypeScript
    What the test does
    The module is imported; the TypeScript file type-checks in strict mode, and naming a token that doesn’t exist is a type error.
  • JSON (DTCG, Style Dictionary)
    What the test does
    Re-imported by Stoaken’s own DTCG check, and built with Style Dictionary v5.
  • Jetpack Compose
    What the test does
    Compiled with the Kotlin compiler next to code that uses it in a TextStyle, a Color and padding.
  • Swift
    What the test does
    Type-checked with the Swift compiler next to code that uses it as a Color, padding and an animation.
  • Android
    What the test does
    Parsed and checked against Android’s resource rules: names, colours as #AARRGGBB, dimensions in dp or sp.
  • API, MCP and CLI
    What the test does
    Called over HTTP against the built app with a real API key: every format comes back byte-for-byte as the exporter made it, and the CLI’s --check fails when a file is out of date.
FormatWhat the test does
CSS variablesParsed by a real CSS parser, then applied in a browser: a button reads its colour and padding from the file, in the default mode and after switching to dark the way the file says.
CSS, light and darkApplied in a browser set to light, then dark: the page follows the device by itself.
Tailwind 4Tailwind v4 builds utilities from the theme file (bg-brand-primary, p-md) and a browser paints them with the right values.
Tailwind 3Loaded as the config of a real Tailwind v3 build, which generates the utilities.
SCSSCompiled with Dart Sass; the variables come out as the values.
JavaScript, TypeScriptThe module is imported; the TypeScript file type-checks in strict mode, and naming a token that doesn’t exist is a type error.
JSON (DTCG, Style Dictionary)Re-imported by Stoaken’s own DTCG check, and built with Style Dictionary v5.
Jetpack ComposeCompiled with the Kotlin compiler next to code that uses it in a TextStyle, a Color and padding.
SwiftType-checked with the Swift compiler next to code that uses it as a Color, padding and an animation.
AndroidParsed and checked against Android’s resource rules: names, colours as #AARRGGBB, dimensions in dp or sp.
API, MCP and CLICalled over HTTP against the built app with a real API key: every format comes back byte-for-byte as the exporter made it, and the CLI’s --check fails when a file is out of date.

Was this page useful?