Skip to content

Decision Input

Schema

model: string

The decision model identifier determines both:

  • the type of value produced by decision.
  • the decision model used to produce it, and the required input parameters
"model": "color-set/explicit"

All decision models named color-set/* produce a Decision<ColorSet> and expose the resolved ColorSet value, which contains a set of ColorValues, their individual color components, and - when declared - tokens and token references.

The specific color-set/anchored decision model determines how the color scale is generated. In this case, the model starts with an anchor color and applies a modifier to create a number of color steps in either/both directions: up and down.

See Reference: Decision Models for the full list of decision types, their resulting values and available models, and respective parameters.

name: string (non unique)

The decision name is mandatory.

"name": "Green Foreground"

The decision name can be used to create relationships between decisions.

"params": {
"start": { "$name": "Green Foreground" }
}

The same decision name can be declared more than once, as long as

  • the decision is scoped to different contexts each time.
  • the decision type is always the same
[
{
"type": "color-value/explicit",
"name": "Green Foreground",
"params": { "value": "#090E0B" }
},
{
"type": "color-value/explicit",
"name": "Green Foreground",
"contexts": ["Colour Scheme: Light Mode"],
"params": { "value": "#F6FDF8" }
}
]
id: string (optional) (unique)

When provided it can also be used to retrieve decision values and to create relationships between decisions.

"id": "green-foreground-base"

By referencing the record’s uuid, instead of the decision name, you can link a decision to a specific record regardless of applicable context.

"params": {
"start": { "$uuid": "#green-foreground-base" }
}
description: string (optional)

Provide a small description for the decision.

"decription": "Strongest shade of Green"
usage: object (optional)

These guidelines inform the intent of the decision, namely to what they should be applied.

"usage": {
"intendedFor": ["Icons", "Backgrounds"],
"notFor": ["Typography"]
}
contexts: string[] | {all: string[], some?: string[]} (optional)

Contexts inform where, when or to whom a certain design decision is applicable.

The decision value will exist only when at least one of these contexts is present.

"contexts": ["Email", "Support"]

Alternatively, a list of required contexts can be provided via an object:

  • all: string[] - The decision will only be in effect when all these contexts are present.
"contexts": {
"all": ["Email", "Support"]
}
  • some?: string[] - When provided, at least one of these contexts must also be present.
"contexts": {
"all": ["Email", "Support"],
"some": ["Headers", "Footers"]
}
params: object (optional)

The shape of the parameters of each each decision is driven by the decision model.

As an example, the color-set/anchored decision model requires as input:

  • a starting color (here provided as a reference to another decision)
  • a modifier object with SignedPercentage values for
    • h - Hue
    • s - Saturation
    • l - Lightness
  • a number that specifies the total number of steps of the set
"type": "color-set/anchored"
"params": {
"anchor": { "$name": "Green Foreground" },
"after": {
"steps": 5,
"modifier": {
"l": { "mode": "linear", "by": 5 }
}
}
}

In turn, the color-set/explicit decision model, requires only a single parameter: the explicit list of colors (or references) in the set.

"type": "color-set/explicit",
"params": {
"values": ["#312506", "#564109", "#7D5E0A", "#A57B0A"]
}

As another example, the color-value/explicit

The color value can be specified in a number of formats, according to the 🚧 schema.

"type": "color-value/explicit",
"params": {
"value": { "h": 144, "s": 0.22, "l": 0.05 }
}

As well as a decision (or token) reference.

"type": "color-value/explicit",
"params": {
"value": { "$name": "Green Foreground" }
}

See Decision Models Reference for each model’s input parameter.

🚧🚧🚧

tokenize: object (optional)

Declare tokens generated from this decision.