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:
- Margin and padding — top, bottom, left, right
- Position — top, bottom, left, right
- Column and row gaps for display settings and Quick Stack
- Height and width dimensions (including min and max)
- Grid column and row sizes
- Typography — font size, line height, letter spacing
- Border radius and width
- Filter and backdrop filter blur radius
Syntax
Size Units
Parameters
- name : string - Name of the variable
- value: SizeValue - Object with the unit and value of the size.
{unit: SizeUnit, value: number}
- SizeUnit : string - Any of the following units
"px" | "em" | "rem" | "vh" | "vw" | "dvh" | "dvw" | "lvh" | "lvw" | "svh" | "svw" | "vmax" | "vmin" | "ch"
- SizeUnit : string - Any of the following units
Returns
Promise<SizeVariable>
A Promise that resolves to a SizeVariable object