Designer API
Control the Webflow Designer
variable.getBinding()
Returns a binding value for the variable. Use the binding value when creating or updating variables with custom values.
1variable.getBinding(): Promise<string>
Promise<string>
A Promise that resolves to a string representing the variable’s binding.
1// Create a variable2const webflowBlue = await collection?.createColorVariable(3 "blue-500",4 "#146EF5"5);67// Get the binding value for a variable8const binding = await webflowBlue.getBinding();9// binding = "var(--blue-500)"1011// Use the binding value to create a variable with a custom value12const webflowBlue400 = await collection.createColorVariable("blue-400", {13 type: "custom",14 value: `color-mix(in srgb, ${binding}, white 50%)`,15});