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
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
color | ✅ COLOR | — | color | Color | Color |
gradient | — | ✅ Paint | background | LinearGradient | Brush |
img | — | ✅ Paint | background-image | Image | painterResource |
fill | — | ✅ Paint | background | ShapeStyle | Brush |
opacity | ✅ FLOAT | — | opacity | CGFloat | Float |
Dimension
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
dimension | ✅ FLOAT | — | length | CGFloat | Dp |
number | ✅ FLOAT | — | number | CGFloat | Float |
spacing | ✅ FLOAT | — | gap / padding | CGFloat | Dp |
sizing | ✅ FLOAT | — | width / height | CGFloat | Dp |
Borders
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
border | — | — | border | — | — |
borderWidth | ✅ FLOAT | — | border-width | CGFloat | Dp |
borderRadius | ✅ FLOAT | — | border-radius | CGFloat | Dp |
strokeStyle | — | — | border-style | — | — |
Note:
borderandstrokeStyleare composite types that don't export as Figma variables. They apply directly to layers.
Effects
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
shadow | — | ✅ Effect | box-shadow | NSShadow | shadow |
backdrop-blur | — | ✅ Effect | backdrop-filter | blur | BlurEffect |
blur | — | ✅ Effect | filter | blur | Blur |
glass | — | ✅ Effect | backdrop-filter | UIVisualEffect | Blur |
effects | — | ✅ Effect | filter | CALayer | graphicsLayer |
Typography
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
typography | — | ✅ Text | font | Font | TextStyle |
fontFamily | ✅ STRING | — | font-family | String | FontFamily |
fontWeight | ✅ STRING | — | font-weight | String | FontWeight |
fontStyle | — | — | font-style | — | — |
fontSize | ✅ FLOAT | — | font-size | CGFloat | TextUnit |
lineHeight | ✅ FLOAT | — | line-height | CGFloat | TextUnit |
letterSpacing | ✅ FLOAT | — | letter-spacing | CGFloat | TextUnit |
paragraphIndent | ✅ FLOAT | — | text-indent | CGFloat | TextUnit |
paragraphSpacing | ✅ FLOAT | — | margin | CGFloat | TextUnit |
textCase | — | — | text-transform | — | — |
textDecoration | — | — | text-decoration | — | — |
Animation
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
duration | — | — | transition-duration | — | — |
cubicBezier | — | — | cubic-bezier() | — | — |
transition | — | — | transition | — | — |
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
$type | Figma Variable | Figma Style | CSS | Swift | Kotlin |
|---|---|---|---|---|---|
text | ✅ STRING | — | content | String | String |
boolean | ✅ BOOLEAN | — | — | Bool | Boolean |
grid | — | ✅ Grid | grid | LayoutGrid | LazyGrid |
template | — | — | — | — | — |
composition | — | — | — | — | — |
Simple vs Composite types
Simple types
A simple token has a single scalar value: color, number, string, boolean.
{
"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:
{
"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:
{
"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:
| Type | Default scopes |
|---|---|
| Color | ALL_FILLS, STROKE_COLOR, EFFECT_COLOR |
| Dimension | ALL_SCOPES |
| Sizing | WIDTH_HEIGHT |
| Spacing | GAP |
| Border Radius | CORNER_RADIUS |
| Border Width | STROKE_FLOAT |
| Opacity | OPACITY |
| Font Family | FONT_FAMILY |
| Font Weight | FONT_STYLE |
| Font Size | FONT_SIZE |
| Line Height | LINE_HEIGHT |
| Letter Spacing | LETTER_SPACING |
Override scopes via $extensions:
{
"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:
{
"brand-primary": {
"$value": "#6366F1",
"$type": "color",
"$extensions": {
"figma.codeSyntax": {
"Web": "var(--brand-primary)",
"iOS": "Asset.Colors.brandPrimary",
"Android": "@color/brand_primary"
}
}
}
}
Related pages
- Overview: Tokens overview
- JSON format: Token JSON format
- Styles: Color, Gradient, Image, Fill, Opacity
- Dimension: Dimension, Number, Sizing, Spacing
- Borders: Border, Border Width, Border Radius, Stroke Style
- Typography: Font Size, Line Height, Font Weight and more
- Effects: Shadow, Blur, Glass and Effects
- Animation: Duration, Cubic Bezier, Transition
- Other: String, Boolean, Grid, Template