# Sync a color palette to tokens

{% stepper %}
{% step %}

### Sync to tokens

Once the palette is ready, click the `Synchronize` button, then select `Synchronize with tokens`. This creates or updates design tokens directly in Penpot using the plugin API — no manual export or import required.

Tokens are organized by source color and, if color modes have been defined, by theme. They are fully decoupled from the palette: updating the palette does not automatically update the tokens; you need to click `Synchronize with tokens` again to propagate changes.

{% hint style="info" %}
Unlike local styles synchronization, token synchronization uses Penpot's native token API and can be used across any project.
{% endhint %}
{% endstep %}

{% step %}

### Sync with themes

If your palette includes `Color modes`, each mode is reflected as a separate theme in the token set. Click `Synchronize with tokens` to generate or update the token sets for each theme.

Tokens without themes are placed in a single default set. Tokens with themes are placed in separate sets, one per color mode.
{% endstep %}

{% step %}

### Remove tokens no longer linked to the palette

A preference option controls whether tokens that no longer exist in the palette are automatically removed from their sets after synchronization.

To enable it, go to `Preferences` and toggle the relevant option. When enabled, any token previously created from the palette but no longer part of it will be deleted on the next synchronization.

{% hint style="warning" %}
Use this option carefully if you have manually added tokens to the same sets — they could be removed unintentionally.
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ui-color-palette.com/penpot/guides/sync-a-color-palette-to-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
