Open this example in the interactive library
Live preview
Source code
// components/PaletteTokenExporter.tsx
export default function PaletteTokenExporter({
hex = "#bc805a",
}: { hex?: string } = {}) {
return (
<a
download="palette.css"
href={"data:text/css," + encodeURIComponent(":root { --accent: " + hex + "; }")}
>
Download colour token
</a>
);
}
