Skip to content

SVG Design Tokens

About the SVG Design Tokens

Extract the colors, stroke widths, corner radii and fonts of an SVG, name them, and export CSS variables, W3C design tokens or a Tailwind theme. Turn colors into CSS variables so the SVG can be themed. Runs in your browser.

How to use it

Examples

Questions

What does the SVG with color variables do?
Each solid color becomes var(--name, original). Shown as an image, or anywhere the variables are not defined, the original color is used, so nothing changes. Inline in a page, you can set the variables in CSS to recolor it.
Do variables work when the SVG is used as an image?
Only the fallbacks apply, because an image cannot see your page's CSS. To theme it, put the SVG inline in your HTML, or define the variables inside the SVG itself.
What about transparent colors and gradients?
Colors with transparency are left as written, because a variable cannot carry the transparency. Gradients are kept; the colors of their stops become variables.
Are the px values right?
SVG sizes are in user units, which equal pixels when the SVG is shown at its view box size. If you scale the SVG, the numbers scale with it.
Are my files uploaded?
No. Everything runs in your browser, and the file is cleaned before and after.

Free and runs in your browser. Sign in only if you want to save your work.