Variables can store the values of reusable design property. It allows more flexibility in maintaining design consistency and facilitates the implementation of multi-theme designs.
Tip: Before organizing and managing variables, see Variables to learn more about related concepts such as collections, groups, and modes.
Motiff allows you to organize and manage variables through the Variable popup. You can follow these steps to open it:
In any collection, click + Color variable
button.
Name the variable in the first column.
Set the variable value in the second column:
a. Click on the variable value and enter directly. b. Click on the color well to customize the color using the color picker.
Note: Motiff supports creating up to 5,000 variables per collection.
You can group the variables as follows to organize them more effectively:
Note: Motiff supports grouping by name. You can group variables by naming them with /
. Each /
in the naming represents a different level of grouping, with the last part being the variable name. For example, naming a variable Color/Text/H1
will display it as H1
under two hierarchical groups of Color
and Text
.
You can organize groups in the following ways:
Tips:
Variable values can not only be set as color values but also reference an existing variable.
When referencing another variable, you only need to modify the referenced variable, and all associated variables will be updated at the same time.
You can follow these steps to reference another variable:
Right-click on the variable value and select Create alias.
Choose the variable to reference from the library. You can use the Search feature to quickly find the corresponding variable.
If you no longer want to reference this variable, hover over the variable value and click to detach the alias.
A mode refers to a group of variable values under one theme in a collection.
Motiff allows you to define multiple values for the same variable to adapt to different design context, such as light and dark color themes.
Motiff sets the first mode on the left side of a collection as the Default mode. When collaborators use variables, the variable values in this mode are applied by default.
In the page’s mode switcher, the default mode of the collection is displayed in parentheses.
In Motiff, you can open the edit Variable modal in two ways:
In the popup for editing variables, you can perform the following actions:
Code syntax represents how the design variable appears in code, ensuring consistency in the handoff process between designers and developers.
You can set code syntax for a variable. If you add a Web code syntax, the corresponding code will display as property: Color A
.
After setting the code syntax, when you are in Dev Mode and click on the layer that uses the variable, the custom code syntax will be displayed.
Motiff supports adding up to three types of code syntax for each variable, including Web, iOS, and Android. You can create a variable name for each platform:
Setting the scope for a variable limits its application attributes. For example, you can restrict a color variable's scope to Fill, meaning the variable can only be applied to fill properties and will not be applied in stroke or effect properties.
Tip: By default, Motiff selects All supported properties. You can check specific applicable scopes as needed.
Select multiple variables in the variable popup.
Right-click on the selected variables and choose Edit variable.
In the edit Variable modal, you can only edit the following information:
Local variables are variables that exist in the current file. You can view local variables in the Variable popup.
You can follow the steps below to open Variable popup:
Like styles and components, variables can be published to a library for team members to share and use.
Lean more about how to publish a library.
Tip: After publishing, team members need to accept updates to use the latest version of the variables in their files.