不喜欢广告? 无广告 今天

CSS Design Token Generator

颜色开发人员
广告 移除?

品牌颜色

Used as the palette key, e.g. --color-brand-500.

选项

Modern outputs oklch() values; Hex outputs classic #rrggbb.
Scale palette saturation. 100 keeps the brand color's chroma.
广告 移除?

指导

CSS Design Token Generator

CSS Design Token Generator

Turn a single brand hex color into a complete, opinionated CSS custom-property token system. The tool generates an 11-stop perceptually uniform palette in OKLCH space (50 through 950) and layers a semantic token system on top so you can drop the output straight into a design system or component library.

Unlike a quick chat-generated palette, every shade is computed deterministically, gamut-clamped to sRGB, and previewed live as swatches so you can see how the colors look before you copy them. Tokens are exported in modern oklch() values or classic hex, with an optional dark-mode variant ready to paste into a :root 块。

如何使用

  1. Pick a brand color with the color picker or paste a hex value (e.g. #464aff).
  2. Set a name prefix (default brand) — this becomes the key in --color-brand-500.
  3. Choose the output format: modern oklch() for Tailwind v4 / wide-gamut workflows, or classic hex.
  4. Toggle “Include dark mode variant” and pick a strategy (.dark class, [data-theme="dark"] attribute, or prefers-color-scheme media query).
  5. Adjust the chroma slider if you want a softer or punchier palette, then copy the generated CSS or download it as a stylesheet.

特征

  • OKLCH color math – Perceptually uniform 50-950 scale with gamut clamping so every stop stays inside sRGB.
  • Semantic token layer – Outputs roles like --color-primary, --color-surface, --color-on-surface, --color-border, --color-ring,并且 --color-accent.
  • Dark mode variant – Optional second selector that swaps semantic mappings, leaving the raw palette untouched.
  • Live swatch grid – Visual preview of every stop plus an interactive light/dark UI mock so you can sanity-check contrast at a glance.
  • Modern or legacy output – Pick oklch() values or classic hex depending on your browser support target.
  • Chroma slider – Scale palette saturation from 0% (neutral grayscale) up to 150% (richer than your input color).
  • 仅客户端 – Everything runs in your browser; your brand color never leaves the page.
  • 复制或下载 – One-click copy of the full :root {} block or download as a .css 文件。

广告 移除?

常问问题

  1. What is OKLCH and why use it for palette generation?

    OKLCH is a polar form of the Oklab color space designed to be perceptually uniform. Equal numerical differences in lightness or chroma correspond to roughly equal perceived differences. That makes it ideal for generating palettes where each step (50, 100, 200, …) feels evenly spaced to the eye, unlike HSL, which produces uneven jumps especially in the yellow-green range.

  2. What is a design token?

    A design token is a named variable that stores a design decision — a color, a spacing value, a font size, and so on. Instead of repeating raw values like #464aff across your codebase, you reference a token like --color-primary. Tokens give designers and developers a single source of truth and make systemic changes (rebrand, theme switch, dark mode) trivial.

  3. What is the difference between a raw palette and a semantic token?

    A raw palette token names a color by its appearance and position in a scale, like --color-brand-500. A semantic token names a color by its purpose, like --color-primary or --color-on-surface. Components should consume semantic tokens so the same component renders correctly in light, dark, or any future theme — the semantic layer maps to whichever raw shade is appropriate.

  4. Why are semantic tokens better than referencing raw palette values directly?

    Semantic tokens decouple intent from implementation. If you write background: var(--color-brand-600) everywhere, switching themes means rewriting every component. If you write background: var(--color-primary), only the semantic mapping changes between themes. This is the same principle that drives Material Design 3, IBM Carbon, and shadcn/ui token systems.

  5. What does gamut clamping mean?

    sRGB — the color space most screens render — cannot represent every OKLCH coordinate. When a generated stop falls outside sRGB, its chroma is reduced until the color fits. This keeps the palette visually consistent across devices but means very saturated brand colors lose a small amount of vibrancy at extreme lightness levels.

  6. What is the on-surface naming convention?

    In a semantic system, --color-on-X names the foreground color you should use when X is the background. So --color-on-primary is the text color to use on top of --color-primary, and --color-on-surface is the body text color used on --color-surface. The pattern guarantees readable contrast pairs without making every component pick its own foreground.

想要享受无广告的体验吗? 立即无广告

安装我们的扩展

将 IO 工具添加到您最喜欢的浏览器,以便即时访问和更快地搜索

添加 Chrome 扩展程序 添加 边缘延伸 添加 Firefox 扩展 添加 Opera 扩展

记分板已到达!

记分板 是一种有趣的跟踪您游戏的方式,所有数据都存储在您的浏览器中。更多功能即将推出!

广告 移除?
广告 移除?
广告 移除?

新闻角 包含技术亮点

参与其中

帮助我们继续提供有价值的免费工具

给我买杯咖啡
广告 移除?