Tokens

Styles

Styles group token types: Color, Gradient, Image, Fill, Opacity — accepted value shapes, keys, modifiers, and export behavior with examples.

Overview

The Styles group holds the paint-like and opacity token types. color and opacity export as Figma variables; gradient, img, and fill export as paint styles.

$typeExports asValue in one line
colorVariable (COLOR)Hex / rgb / hsl / color() string, or { r,g,b,a }
gradientPaint styleCSS gradient string, alias, or gradient object
imgPaint styleImage URL or image object
fillPaint styleOne paint or an array of paint layers
opacityVariable (FLOAT)01, a % string, or an alias

Color

Exported as a COLOR variable. Default scopes: ALL_FILLS, STROKE_COLOR, EFFECT_COLOR.

Accepted $valueExample
Hex"#635BFF", "#635BFF80"
rgb() / rgba()"rgba(99, 91, 255, 0.8)"
hsl() / hsla()"hsl(244, 100%, 68%)"
color()"color(display-p3 0.4 0.36 1)"
Object (channels 01){ "r": 0.39, "g": 0.36, "b": 1, "a": 1 }
Alias"{color.brand.primary}"
JSON
{ "$type": "color", "$value": "#635BFF" }

Color modifiers — derive a color from another with $extensions.figma.modify:

FieldValues
typelighten, darken, alpha, mix
valueAmount 01
spacesrgb, hsl, lch, oklch, p3 (default oklch)
colorTarget color — required for mix
JSON
{
  "$type": "color",
  "$value": "{color.brand.primary}",
  "$extensions": {
    "figma.modify": [
      { "type": "lighten", "value": 0.12, "space": "oklch" },
      { "type": "alpha", "value": 0.6 }
    ]
  }
}

Gradient

Exported as a paint style. Write a CSS gradient string, an alias, or a gradient object.

Accepted $valueExample
CSS gradient string"linear-gradient(135deg, #635BFF 0%, #A78BFA 100%)"
Alias"{gradient.brand}"
Gradient objectsee keys below

Supported CSS functions: linear-gradient, radial-gradient, angular-gradient (conic), diamond-gradient.

Gradient object keys:

KeyValues
typelinear, radial, angular, diamond
angleNumber, degrees (for linear)
stopsArray of { "position": 0–1, "color": "#…" }
gradientTransformOptional Figma transform matrix
JSON
{
  "$type": "gradient",
  "$value": {
    "type": "linear",
    "angle": 135,
    "stops": [
      { "position": 0, "color": "#635BFF" },
      { "position": 1, "color": "#A78BFA" }
    ]
  }
}

Image (img)

Exported as a paint style with an image paint.

Accepted $valueExample
URL string"https://…/cover.png" or "url(https://…/cover.png)"
Image object{ "url": "https://…", "scaleMode": "FILL", "opacity": 1 }
Alias"{img.cover}"

scaleMode: FILL, FIT, CROP, TILE.

JSON
{ "$type": "img", "$value": { "url": "https://…/cover.png", "scaleMode": "FILL" } }

Fill

A fill is the most flexible paint type: a single paint, or a stack of paint layers (bottom-to-top order, last on top). Exported as a paint style.

Accepted $valueExample
Color / gradient / image string"#635BFF", "linear-gradient(…)"
Single layer object{ "type": "solid", "color": "#635BFF" }
Array of layerssee example
Alias"{fill.card}"

Fill layer keys:

KeyValues
typesolid, gradient, image
colorColor string (for solid)
gradientGradient object (for gradient)
url / imageUrlImage URL (for image)
scaleModeFILL, FIT, CROP, TILE (for image)
opacity01
blendModeFigma blend mode (e.g. NORMAL, MULTIPLY)
visibletrue / false
JSON
{
  "$type": "fill",
  "$value": [
    { "type": "image", "url": "https://…/photo.jpg", "scaleMode": "FILL", "opacity": 0.7 },
    { "type": "solid", "color": "#00000029" }
  ]
}

Opacity

Exported as a FLOAT variable. Default scope: OPACITY.

Accepted $valueExample
Number 010.6
Percent string"60%"
Alias / math"{opacity.disabled}", "{opacity.base} * 0.5"

0.6 and "60%" resolve to the same value (0.6) — pick whichever reads better in your system. The variable is always stored as a 01 float.

JSON
{ "$type": "opacity", "$value": 0.6 }
{ "$type": "opacity", "$value": "60%" }