collection.createFontFamilyVariable(name, value)
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): 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
// 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 Ability | Locale | Branch | Workflow | Sitemode |
---|---|---|---|---|
canModifyVariables | Any | Main | Canvas | Design |