Create font family variable

collection.createFontFamilyVariable(name, value)

Create a Font Family variable with a name for the variable, and name for the Font Family.

Syntax

collection.createFontFamilyVariable(
name: string,
value: string | FontFamilyVariable,
options?: {
mode?: VariableMode
}
): Promise<FontFamilyVariable>

Parameters

  • name : string - Name of the variable
  • value: string | FontFamilyVariable - Font Name
  • options: object - Optional parameters for the variable.

Returns

Promise<FontFamilyVariable>

A Promise that resolves to a FontFamilyVariable object

Example

// Get Collection
const collection = await webflow.getDefaultVariableCollection()
// Create Font Family Variable with a Font Family Name
const myFontFamilyVariable = await collection?.createFontFamilyVariable("Default Font", "Inter")
console.log(myFontFamilyVariable)

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign