Playground

Build a Tailwind CSS 3 or 4 theme from your own tokens right in the browser, with nothing to install.

The playground runs tailwind-dictionary in the browser. Change the tokens and the result and the preview update a moment later. The input tabs:

  • tokens.json — base tokens in the DTCG format: palette, sizes, fonts, text styles, shadows, breakpoints, animations;
  • light.json and dark.json — semantic theme tokens: data-theme switches them on any element of the page;
  • config.json — theme aliases (themeAliases) and theme settings (themes.default, themes.prefix). The Tailwind version is switched with the button above the editor, each version has its own set of aliases. source and output are not needed: tokens come from the tabs.
Building…

Building…

Preview

Building…

How it works

  • The browser calls generate(), the same code as in the CLI. Tokens and config are not sent to a server and never leave the page.
  • The generator is loaded on the first build, not with the page.
  • The preview is an isolated iframe with no network access. The Tailwind 4 result contains the @theme directive, which browsers do not understand, so the preview puts its variables into :root. A real project needs Tailwind.
  • Colors in the example are written as strings ("#2563eb") to make them easy to edit. The DTCG object form (colorSpace, components, hex) is supported too.
  • If the tokens have an error, a message is shown under the editor and the result stays at the last successful one.

What next

Copy the tokens and the config into your project and run the CLI: quick start. Ready-made tokens of the same structure are in pbstyles. For LESS and SCSS there is the mixin-dictionary playground.