Styles
Styles group token types: Color, Gradient, Image, Fill, Opacity — formats, keys, modifiers, and export behavior.
Color
color is the base token type for interface colors.
Export: Variable (COLOR).
Accepted $value formats
| Format | Example |
|---|---|
| HEX | #6366F1, #6366F180, #F00 |
| RGB/RGBA | rgb(99, 102, 241), rgba(99, 102, 241, 0.5) |
| HSL/HSLA | hsl(239, 84%, 67%), hsla(239, 84%, 67%, 0.5) |
| Object | { "r": 0.39, "g": 0.40, "b": 0.95, "a": 1 } |
| Alias | {color.brand.primary} |
Color modifiers ($extensions.figma.modify)
SXL Studio supports modifier chains over a base color alias/value.
JSON
{
"color": {
"$type": "color",
"primary": { "$value": "#6366F1" },
"primary-light": {
"$value": "{color.primary}",
"$extensions": {
"figma.modify": { "type": "lighten", "value": 0.12, "space": "oklch" }
}
},
"primary-dark": {
"$value": "{color.primary}",
"$extensions": {
"figma.modify": { "type": "darken", "value": 0.18, "space": "oklch" }
}
},
"primary-contrast": {
"$value": "{color.primary}",
"$extensions": {
"figma.modify": [
{ "type": "mix", "value": 0.24, "color": "#ffffff", "space": "srgb" },
{ "type": "alpha", "value": 0.92 }
]
}
}
}
}
| Key | Required | Values |
|---|---|---|
type | ✅ | lighten, darken, alpha, mix |
value | ✅ | number 0..1 or alias string |
space | optional | srgb, hsl, lch, oklch, p3 |
color | for mix | second color (#..., rgb(...), alias) |
Notes:
figma.modifycan be one object or an array (applied in order).- if
spaceis omitted,oklchis used. alphaupdates opacity.mixblends current color withcolorbyvalue.
Gradient
gradient defines a gradient fill.
Export: Paint Style.
Accepted $value formats
- CSS gradient string
JSON
{
"gradient": {
"$type": "gradient",
"brand": { "$value": "linear-gradient(135deg, #6366F1 0%, #EC4899 100%)" }
}
}
- Gradient object
JSON
{
"gradient": {
"hero": {
"$type": "gradient",
"$value": {
"type": "linear",
"angle": 135,
"stops": [
{ "position": 0, "color": "#6366F1" },
{ "position": 1, "color": "#EC4899" }
]
}
}
}
}
Gradient object keys
| Key | Type | Notes |
|---|---|---|
type | string | linear, radial, angular, diamond |
angle | number | used when gradientTransform is not provided |
stops | array | required for object form; each stop: { position, color } |
gradientTransform | [[a,b,c],[d,e,f]] | optional explicit transform matrix |
Notes:
- String
conic-gradient(...)is parsed as angular gradient. - Stop
colorsupports literal color or token alias. - For object format, use normalized 0..1
positionvalues.
Image (img)
img is for image paint values.
Export: Paint Style (paint pipeline).
Accepted $value formats
- URL string /
url(...)
JSON
{
"img": {
"$type": "img",
"hero": { "$value": "https://cdn.example.com/hero.jpg" }
}
}
- Object
JSON
{
"img": {
"pattern": {
"$type": "img",
"$value": {
"type": "image",
"url": "https://cdn.example.com/pattern.png",
"scaleMode": "FILL",
"opacity": 0.8,
"blendMode": "NORMAL"
}
}
}
}
| Key | Type | Notes |
|---|---|---|
type | string | use image |
url / imageUrl / src / href | string | image source |
scaleMode | string | FILL, FIT, CROP, TILE |
opacity | number | 0..1 |
blendMode | string | Figma blend mode |
Fill
fill is a universal paint token: solid, gradient, image, or multi-layer stack.
Export: Paint Style.
Accepted $value formats
- color/gradient/image string;
- alias string (
{fill.surface}or{color.brand.500}); - one object layer;
- array of layers.
Fill layer object keys
| Key | Type | Notes |
|---|---|---|
type | string | solid, gradient, image |
color | string | for solid; literal or alias |
gradient | object | for gradient; uses type/angle/stops/gradientTransform |
url / imageUrl / src / href | string | for image |
scaleMode | string | image scale mode |
opacity | number | layer opacity (0..1) |
blendMode | string | layer blend mode |
visible | boolean | defaults to true |
Example: multi-layer fill
JSON
{
"fill": {
"$type": "fill",
"card": {
"$value": [
{
"type": "solid",
"color": "#FFFFFF",
"opacity": 0.92,
"blendMode": "NORMAL"
},
{
"type": "gradient",
"gradient": {
"type": "linear",
"angle": 180,
"stops": [
{ "position": 0, "color": "#F6F3FF" },
{ "position": 1, "color": "#FFFFFF" }
]
},
"opacity": 1,
"blendMode": "MULTIPLY"
},
{
"type": "image",
"url": "https://cdn.example.com/noise.png",
"scaleMode": "TILE",
"opacity": 0.16,
"blendMode": "OVERLAY"
}
]
}
}
}
Opacity
opacity controls layer transparency.
Export: Variable (FLOAT), scope OPACITY.
Accepted $value formats
| Format | Example |
|---|---|
| 0..1 float | 0.6 |
| 0..100 number | 60 |
| percent string | "60%" |
| alias | {opacity.overlay} |
JSON
{
"opacity": {
"$type": "opacity",
"disabled": { "$value": 0.4 },
"overlay": { "$value": "60%" },
"hover": { "$value": "{opacity.overlay}" }
}
}
Notes:
- For Figma variable export, values
0..1are stored as0..100scale. - For apply to node, values above
1are treated as percent-like (60->0.6). - Unlike most float tokens, opacity
%is not converted viaremBase.
Related pages
- Overview: Tokens overview
- Types: All token types
- Effects: Shadow, Blur, Glass, Effects
- Composition: Composition — style system and structure