技能 设计创意 设计令牌映射工具

设计令牌映射工具

v20261120
design-how-token-mapping
此技能生成硬编码样式与语义设计令牌之间的只读映射。它识别精确、近似、模糊和缺失的匹配项,用于设计审计。该工具帮助开发者理解硬编码样式与设计系统令牌的关系,而无需修改文件。它根据语义角色分类匹配项,并报告颜色或单位的差异。适用于设计系统维护和审计。
获取技能
474 次下载
概览

Map Styling to Tokens

When to Use

Use for a page, file or diff that needs a design-token audit. For applying changes, use design-how-build-design-system.

Workflow

  1. Locate the token definitions actually used by the project and resolve aliases and theme overrides. Note property, state, context, units and frequency for each literal. Inspect computed styles when declarations alone cannot explain the rendered value.
  2. Match by semantic role first, then compare resolved values. Prefer exact matches that hold in all applicable themes. Treat equal colors with incompatible roles as ambiguous. For near matches, report the measured difference and units, using a consistent perceptual color metric where available.
  3. Classify each row as exact, near, ambiguous, no token, or intentional exception. Show source location, raw value, candidate token and trade-off. Flag text/surface combinations whose contrast could change. For no token, suggest a role name without modifying the registry.

Example

On a danger alert, #ad2139 matches both --badge-brand and --text-danger in light mode. Check dark mode and prefer the danger role for alert text, recording the rejected candidate.

Limitations

This is a report. Do not edit files or create tokens. A missing theme or unresolved computed style lowers confidence and must appear in the result.

Bundled resources

Apply the bundled mapping rules. Use the glossary in the installed design-how-build-design-system sibling when available.

Source

Adapted from design.how by Arlan Marat. See MIT license.

信息
分类 设计创意
名称 design-how-token-mapping
版本 v20261120
大小 3.88KB
更新时间 2026-11-21
语言