Configuration file 101
Learn more about how to setup your Specify configuration file to generate design tokens and assets fitting your company standards.
Last updated
Was this helpful?
Learn more about how to setup your Specify configuration file to generate design tokens and assets fitting your company standards.
Last updated
Was this helpful?
Whenever you want to work with the GitHub or the Specify CLI destination, you need to create a Configuration file to instruct the Parsers Engine how to transform your design data, so it generate tokens that match your technical requirements.
A configuration file helps you:
request design tokens and assets from a Specify repository
transform them to fit your company standards thanks to parsers
A configuration is composed of 3 main properties:
repository
personalAccessToken
rules
The name of the Specify repository
you want to pull your design tokens and assets from.
Let's say we have the following repository in Specify called "all-design-data" located in the "@acme-inc" organization.
We target it like this:
The Specify personalAccessToken
used to authenticate you.
The Parsers Rules help you transform your design tokens and assets the way you want.
You can have as many rules
as you want and you can have rules that transform several Token types at once.
Here are different kind of rules and parsers you can use to generate color tokens as CSS Custom Properties:
filter to target on a specific collection named "Colors" that contains our colors
convert-color to convert our colors in HSL
change-case to change the name of our tokens and modes to kebabCase
to-css-custom-properties to generate a CSS file containing our tokens
The following examples are made to be used with the Specify CLI.
Requirements:
a Specify repository containing design tokens
a valid personal access token (Generate one ↗)
Run all examples by copying the code and running the specify pull
command.
Here's a basic configuration file that targets a Specify repository called design-system
from the @acme-inc
organization:
This example config file will return a colors.css
file containing all design tokens stored in the design-system
repository.
Here's an example of a token value returned by Specify:
Now let's update our previous configuration to only pull colors and transform them as CSS Custom Properties in RGB.
Here is the input returned by Specify and the output generated by Specify after executing our configuration.