Tokens

Token types

Complete map of all SXL Studio token types: mapping to Figma Variables, CSS, Swift, and Kotlin, groups, and export capabilities.

Overview

SXL Studio supports 35 token types compatible with the Design Tokens Community Group (DTCG) format. Each type is defined by the $type field in a JSON file and determines how the value is interpreted, applied to Figma layers, and exported to code.

Types are divided into simple (single scalar value) and composite (object with multiple properties).

Type mapping

Styles

$typeFigma VariableFigma StyleCSSSwiftKotlin
color✅ COLORcolorColorColor
gradient✅ PaintbackgroundLinearGradientBrush
img✅ Paintbackground-imageImagepainterResource
fill✅ PaintbackgroundShapeStyleBrush
opacity✅ FLOATopacityCGFloatFloat

Dimension

$typeFigma VariableFigma StyleCSSSwiftKotlin
dimension✅ FLOATlengthCGFloatDp
number✅ FLOATnumberCGFloatFloat
spacing✅ FLOATgap / paddingCGFloatDp
sizing✅ FLOATwidth / heightCGFloatDp

Borders

$typeFigma VariableFigma StyleCSSSwiftKotlin
borderborder
borderWidth✅ FLOATborder-widthCGFloatDp
borderRadius✅ FLOATborder-radiusCGFloatDp
strokeStyleborder-style

Note: border and strokeStyle are composite types that don't export as Figma variables. They apply directly to layers.

Effects

$typeFigma VariableFigma StyleCSSSwiftKotlin
shadow✅ Effectbox-shadowNSShadowshadow
backdrop-blur✅ Effectbackdrop-filterblurBlurEffect
blur✅ EffectfilterblurBlur
glass✅ Effectbackdrop-filterUIVisualEffectBlur
effects✅ EffectfilterCALayergraphicsLayer

Typography

$typeFigma VariableFigma StyleCSSSwiftKotlin
typography✅ TextfontFontTextStyle
fontFamily✅ STRINGfont-familyStringFontFamily
fontWeight✅ STRINGfont-weightStringFontWeight
fontStylefont-style
fontSize✅ FLOATfont-sizeCGFloatTextUnit
lineHeight✅ FLOATline-heightCGFloatTextUnit
letterSpacing✅ FLOATletter-spacingCGFloatTextUnit
paragraphIndent✅ FLOATtext-indentCGFloatTextUnit
paragraphSpacing✅ FLOATmarginCGFloatTextUnit
textCasetext-transform
textDecorationtext-decoration

Animation

$typeFigma VariableFigma StyleCSSSwiftKotlin
durationtransition-duration
cubicBeziercubic-bezier()
transitiontransition

Note: animation tokens have no visual representation in Figma. They are designed for code export to ensure consistent motion systems between design and development.

Other

$typeFigma VariableFigma StyleCSSSwiftKotlin
text✅ STRINGcontentStringString
boolean✅ BOOLEANBoolBoolean
grid✅ GridgridLayoutGridLazyGrid
template
composition

Simple vs Composite types

Simple types

A simple token has a single scalar value: color, number, string, boolean.

JSON
{
  "spacing-md": {
    "$value": "16px",
    "$type": "spacing"
  }
}

Simple types: color, opacity, dimension, number, spacing, sizing, borderWidth, borderRadius, fontFamily, fontWeight, fontStyle, fontSize, lineHeight, letterSpacing, paragraphIndent, paragraphSpacing, textCase, textDecoration, duration, cubicBezier, text, boolean, strokeStyle.

Composite types

A composite token is an object with multiple properties:

JSON
{
  "heading-lg": {
    "$value": {
      "fontFamily": "Inter",
      "fontSize": "32px",
      "fontWeight": 700,
      "lineHeight": "40px",
      "letterSpacing": "-0.02em"
    },
    "$type": "typography"
  }
}

Composite types: typography, shadow, blur, backdrop-blur, effects, glass, gradient, fill, img, grid, border, transition, template, composition.

Type inheritance

A type can be set at the group level — all child tokens inherit it:

JSON
{
  "spacing": {
    "$type": "spacing",
    "xs": { "$value": "4px" },
    "sm": { "$value": "8px" },
    "md": { "$value": "16px" },
    "lg": { "$value": "24px" },
    "xl": { "$value": "32px" }
  }
}

Priority: token → nearest parent group → file root.

Variable scopes (Figma Scopes)

When exporting to Figma Variables, each token gets scopes — constraints on where the variable can be used:

TypeDefault scopes
ColorALL_FILLS, STROKE_COLOR, EFFECT_COLOR
DimensionALL_SCOPES
SizingWIDTH_HEIGHT
SpacingGAP
Border RadiusCORNER_RADIUS
Border WidthSTROKE_FLOAT
OpacityOPACITY
Font FamilyFONT_FAMILY
Font WeightFONT_STYLE
Font SizeFONT_SIZE
Line HeightLINE_HEIGHT
Letter SpacingLETTER_SPACING

Override scopes via $extensions:

JSON
{
  "brand-color": {
    "$value": "#6366F1",
    "$type": "color",
    "$extensions": {
      "figma.scopes": ["ALL_FILLS", "STROKE_COLOR"]
    }
  }
}

Code Syntax

Set custom code syntax visible to developers in Figma Dev Mode:

JSON
{
  "brand-primary": {
    "$value": "#6366F1",
    "$type": "color",
    "$extensions": {
      "figma.codeSyntax": {
        "Web": "var(--brand-primary)",
        "iOS": "Asset.Colors.brandPrimary",
        "Android": "@color/brand_primary"
      }
    }
  }
}