NoFOMO
搜索 中EN 登录 注册

最高第 9 名 已下榜

设计系统双层token方案

Emil Kowalski提出设计系统用原始值与语义token两层,让AI智能体按角色而非任意值取色并自动切换主题。

名次变化

原推

Emil Kowalski @emilkowalski 12.2万 粉丝

A good design system makes it harder for both humans and AI agents to make bad decisions. In this ideal setup, tokens come in two layers: - *Primitives* are the raw values without meaning: sand.1000 is rgb(130, 130, 124). - *Semantic tokens* define roles: content-tertiary points to sand.1000 in light mode and ink.1000 in dark mode. This has two benefits: 1. Your agent refers to roles, not arbitrary values. 2. Theme switching happens automatically by changing the primitives behind the semantic tokens. Both of these benefit agents and humans because they reduce the margin for error. You, and your agent, are less likely to use content-tertiary for a heading than an arbitrary hex value like #432154. The token communicates its purpose, a raw hex value has no real meaning to it. And when theming is handled through semantic tokens, you don't have to rely on manually adding Tailwind's dark: modifier everywhere. This is nothing new fwiw, this approached has worked for years. What works well for humans, will likely work well for agents as well.
推文配图
1,285点赞 28转发 63回复 3.5万浏览

在 X 上查看 收藏

X 上的热门回复

登录后查看 X 上的 1 条热门回复

来自 @sharearux 等,已过滤广告,附中英文翻译。

免费注册 已有账号?登录

讨论 0

还没有人讨论,来说第一句。

推荐信源

觉得我们漏了哪个一手信源,或者该关注什么话题?告诉我们。审核通过后,所有人的榜单都会覆盖到它。

@用户名,或者主页链接