1 Generate your token file

Generate your token file

Head to the designtoken.md generator and configure your design system:

Open the generator →
2 Place it in your project

Place it in your project root

Drop the file at the root of your project so Copilot can access it as context:

your-project/
├── designtoken.md    ← place it here
├── src/
├── package.json
└── ...

Copilot reads open files and project context to inform its suggestions. By placing designtoken.md at the top level and keeping it open in a tab, Copilot will reference the token values when generating inline suggestions and completions.

3 Use with Copilot

Start building with tokens

Keep designtoken.md open in a tab while you work. Copilot uses open files as context, so having the token file visible helps it suggest the right values.

You can also reference token names in comments to guide Copilot's suggestions:

// Build a card component using designtoken.md tokens
// Use --color-primary-500, --space-md, --radius-lg

function Card({ title, children }) {
  // Copilot will suggest token-based styles here
}

For Copilot Chat, reference the file directly in your prompts:

"Create a nav component using the design tokens from designtoken.md.
Use the color scale, spacing tokens, and typography settings."

Copilot will use the token values for inline suggestions and completions, keeping your UI consistent with your design system.

Before & after

See the difference tokens make in what your agent outputs:

Without tokens (generic)
<button style="
  background: blue;
  color: white;
  padding: 10px 20px;
">
  Click me
</button>
With designtoken.md
<button style="
  background: var(--color-primary-500);
  color: #fff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
">
  Click me
</button>

With tokens, every suggestion Copilot makes uses your actual design values instead of arbitrary defaults.

Tip

Copilot works best with designtoken.md when the file is open in a tab. If you close it, Copilot may fall back to generic values. Pin the tab to keep it always available as context.

Best practices

Frequently asked questions

Does Copilot read designtoken.md?
Yes. Copilot reads open files and project context to inform its suggestions. When designtoken.md is open in a tab or referenced in your project, Copilot will use the token values for inline suggestions and completions.
How do I get better suggestions?
Keep designtoken.md open in a tab while you work and reference token names in your code comments. For example, adding a comment like // use --color-primary-500 for the background gives Copilot a clear signal to use your tokens.
Does this work with Copilot Chat?
Yes. You can reference the designtoken.md file directly in your Copilot Chat prompts. Ask Copilot Chat to "use the tokens from designtoken.md" when generating components, and it will read and apply your design system values.
Generate your designtoken.md →