collection.createFontFamilyVariable(name, value)

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

Syntax

1collection.createFontFamilyVariable(name: string, value: string | FontFamilyVariable): Promise<FontFamilyVariable>

Parameters

  • name : string - Name of the variable
  • value: string - Font Name

Returns

Promise<Variable>

A Promise that resolves to a Variable object

Example

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

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canModifyVariablesAnyMainCanvasDesign