backgroundColor
The fill painted behind an element’s contents.
Path
…elements.<element>.styles.backgroundColor
Elements Supported
component · container · rectangle · slot
Value
TokenReference
A design token, written as a $token path plus a $type, as in { $token: Color/On surface, $type: color }. The consuming platform resolves it to a value.
$token: Color/Secondary container$type: colorGradientValue
One of three cross-platform gradient types: linear, radial or angular. Diamond is intentionally excluded.
type: LINEARangle: 180stops: - position: 0 color: "#FF6600FF" - position: 1 color: "#FFFFFFFF"ColorObject
An inline resolved color — a colorSpace such as srgb, display-p3 or oklch, plus its components, as in { colorSpace: srgb, components: [1, 0.4, 0], alpha: 1 }. Carried when settings.spec.color asks for an object rather than a string.
colorSpace: srgbcomponents: [1, 0.4, 0]alpha: 1hex: "#FF6600"ColorString
A color as one string — #FF6600, #FF6600FF, rgb(255, 102, 0), rgba(255, 102, 0, 1), hsla(24, 100%, 50%, 1), hsb(24, 100%, 100%), oklch(0.7 0.15 50 / 1) or oklab(0.7 0.1 0.1 / 1).
"#FF6600""#FF6600FF""rgb(255, 102, 0)""rgba(255, 102, 0, 1)""hsla(24, 100%, 50%, 1)""hsb(24, 100%, 100%)""oklch(0.7 0.15 50 / 1)""oklab(0.7 0.1 0.1 / 1)"
ColorStack
Two or more colour values painted over each other, the bottom one first — as in [{ "$token": "Color/Surface", "$type": "color" }, { "type": "LINEAR", "angle": 180, "stops": [ … ] }], a scrim gradient over a surface colour.
null (default)
Themes
A TokenReference written here resolves under the theme in force on this element — the one it selects in themes, or the nearest ancestor’s. The same token path yields a different value under a different theme.
Platform bindings
Figma
Disposition: bound · Realised by: node.fills
Reads Figma’s fills; the name diverges because a spec names the role the colour plays, not the Figma property it came from (ADR-009). Resolves in four steps — gradient, resolved style, bound variable, cached raw value — and writes a single solid paint. A token with neither a resolvable variable nor a cached raw value is skipped with a warning, which is the degradation DSPEC-43 permits. Loss: colorSpace is never read, so components are taken as sRGB regardless; a none component becomes 0; components beyond the third are dropped. Never applied to a text node.
CSS
Disposition: approximated · Realised by: fills
Emits background. A gradient resolves to a CSS gradient function; a null becomes transparent. Loss: a gradient stop whose position is not a number silently becomes 0, and a gradient with fewer than two resolvable stops is dropped entirely rather than degraded.
Decisions
- ADR-003 — Gradient Support for Color Style Properties
- ADR-043 — Custom Color Format Configuration
- ADR-113 — Style defaults belong to the schema
- ADR-130 — Color stacks — a layered fill or stroke as an ordered list
Rules
| Rule | Statement |
|---|---|
| DSPEC-44 | Every property of Styles declares a default, and its value validates against that property’s own schema |
| DSPEC-45 | A declared default is a literal, never a TokenReference, PropBinding or Conditional |
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |