Create size variable
collection.createSizeVariable(name, value)
Create a Size variable with a name for the variable, and size value.
Once created, you can set size variables for:
Syntax
Parameters
-
name : string - Name of the variable
-
value:
- SizeValue - Object with the unit and value of the size.
{unit: SizeUnit, value: number}-
SizeUnit See the accordion below for the list of supported units.
Size Units
Absolute Units
Relative Units
Viewport-based Units
Dynamic Viewport Units
-
- SizeVariable - A reference to another size variable
- CustomValue - A custom value for the variable
- SizeValue - Object with the unit and value of the size.
-
options: object - Optional parameters for the variable.
- mode: VariableMode - The variable mode object. Get the variable mode by using the
collection.getVariableModeByName()method.
- mode: VariableMode - The variable mode object. Get the variable mode by using the
Returns
Promise<SizeVariable>
A Promise that resolves to a SizeVariable object