Getting started
Build your theme
How to set up your theme in Designsystemet with Design Tokens for design and code.
Designsystemet is designed to be used with your own visual identity, including colours and other preferences. With the Designsystemet Theme Builder, you can set up your theme and generate Design Tokens that can be used both in design tools and in code. Design Tokens ensure that both design and code use the same values.
We recommend that both a developer and a designer take part in the process when setting up your theme.
How to get started:
- Use Designsystemets Themebuilder to set up your theme and get started, or use the example below as a starting point.
- The config file must be saved as a
jsonfile, we recommend e.g.designsystemet.config.jsonor<your-organization>.config.json.
{
"output": ["design-tokens", "css"],
"themes": {
"theme": {
"colors": {
"primary": "#0062BA",
"neutral": "#1E2B3C",
"extra1": "#F45F63"
},
"borderRadius": 4
}
}
}
-
Find a Git repository where you can store your Design Tokens. Place the
designsystemet.config.jsonfile in the root of the repository. -
Clone the repository locally to your machine, open a terminal, and navigate to the folder containing the repository.
-
Make sure you have Node.js installed, version
22.12.0or later. -
Run the following command in the terminal:
npx @digdir/designsystemet@latest
This generates Design Tokens based on the configuration file and saves them in a folder called designsystemet/design-tokens, and CSS built from them in a folder called designsystemet. What is generated, and where, is set by the output field in the configuration file. You need "design-tokens" in output to get Design Tokens for Figma. Push the changes to your repository.
-
Fetch the component library from Figma Community (figma.com) (Click “Open in Figma”) into your organisation that has at least a Pro licence. Note that this will be a copy of the component library without any connection to the main file.
-
Install the plugin Tokens Studio (figma.com). This plugin enables synchronisation between Figma and code. You do not need a Pro licence.

- In the plugin, set up the connection to your Git repository. See Tokens Studio’s guide “Sync your Design Tokens with code (tokens.studio)” which explains how to do this for different Git providers.
- Remember to set the “Token storage location” to
designsystemet/design-tokens(or whatever you have named your Design Tokens folder).
We recommend not pushing changes to Design Tokens from Tokens Studio, as this may cause you to lose your overrides when updating.
- Go to the Theme Builder and generate colour scales based on your brand colours. Click “Apply theme”. Copy the configuration file and paste it into the
designsystemet.config.jsonfile in your repository. Keep theoutputfield from step 1, so the Design Tokens are still generated. Run the command below and push the changes.
npx @digdir/designsystemet@latest --config designsystemet.config.json
Remember to run this command every time you make changes to the configuration file.
- In Tokens Studio, select the “Pull” icon to fetch the new tokens into Figma.

Select Styles & variables and Export styles & variables to Figma.

Make sure you have these settings before clicking Confirm:

Select Themes, Select All, and Export to Figma:

You should now see all components using your brand colours in Figma.
Note: Token Studio does not delete existing modes during export. After export, check Theme, Main color, and Support color, and remove any default themes that may still remain from the community file.
If you want additional themes, you can generate a new theme in the Theme Builder and update the configuration file in your repository. Run the command again to generate new Design Tokens, push the changes, and use the “Pull” button in Tokens Studio to fetch the new themes into Figma.
{
"output": ["design-tokens", "css"],
"themes": {
"theme-one": {
"colors": {
"primary": "#0062BA",
"neutral": "#1E2B3C",
"extra1": "#F45F63"
},
"borderRadius": 4
},
"theme-two": {
"colors": {
"primary": "#0062BA",
"neutral": "#1E2B3C",
"extra1": "#F45F63"
},
"borderRadius": 4
}
}
}
When the Design Tokens are updated in code, you can easily fetch the new values into Figma by using the “Pull” button in Tokens Studio again.
- The same command also generates CSS from your theme, in the
designsystemetfolder. This CSS is what you use in code.
Icons in Figma
To get icons working in Figma, they need to be connected to a library stored in your organisation. See the guide "Get icons working in Figma".
Edit this page on github.com (opens in a new tab)