Rename the base variable mode

The base variable mode — the default set of values that variables fall back to — is now first-class in the Designer API. It has the reserved ID "base" and, by default, the name "Base mode".

You can now work with the base mode like any other mode:

// Get the default variable collection
const collection = await webflow.getDefaultVariableCollection()
// Get the base mode by its reserved ID and rename it
const baseMode = await collection.getVariableModeById("base")
console.log(await baseMode?.getName()) // "Base mode"
await baseMode?.setName("Light")

Behavior change: getAllVariableModes includes the base mode

collection.getAllVariableModes() now includes the base mode in the returned array (as the first entry). If your integration iterates over the result, it will now encounter the base mode — for example, when listing or counting a collection’s modes.

const collection = await webflow.getDefaultVariableCollection()
const modes = await collection.getAllVariableModes()
// The base mode is now part of this list
for (const mode of modes) {
console.log(await mode.getName())
}

For more information, see Variable Modes.