DESIGN.md Pro
Skip to article

DESIGN.md vs Design Tokens and When to Use Each

See how a design token stores a reusable value and a DESIGN.md records when to use it, with a border example you can apply in code review.

Omer Aplak3 min read

Consider two borders that share the same gray today. One separates rows in a report. The other marks the edge of a text field. A palette can supply the color for both, but a future contrast change may need to affect only the field.

Give the value a job

A token such as --border-subtle can supply the report divider. A control can use --border-input. Both can reference the same base gray today. When the form border changes later, the table can keep its original weight.

In DESIGN.md, write the usage rule: “Use subtle dividers between report rows. Give editable fields a visible outline and a separate focus indicator.” Name the corresponding tokens and an example component. This tells the implementer how to choose between values that currently look identical.

Trace a validation error from value to behavior

Consider an invoice form that rejects a due date earlier than its issue date. Your token layer may already provide a danger color. The component still needs a message, a place to display it and a way to associate it with the field.

LayerExample decision
TokenThe error border and message use the semantic danger color.
ComponentThe input exposes its invalid state and references the error text.
DESIGN.mdPlace the correction beside the affected field. Keep the entered value visible.
Page copy“Choose a due date on or after March 12.”

Review one variation in grayscale. Can someone locate the invalid field and understand how to fix it? If not, changing the red value alone cannot resolve the missing message. Conversely, if the message works but the border vanishes in dark mode, start with the semantic color and its surface pairing.

For an existing codebase, avoid maintaining a duplicate table of raw hex values in your prose. Link to the token definitions, identify the component that consumes them and include a short example of a decision an implementer might otherwise get wrong. That gives reviewers one place to change a value and another to understand its purpose.

Review a change in both places

Suppose the team decides that selected rows need stronger emphasis. First inspect the row component for existing selection and focus states. Update the relevant token or variant, then add a short note explaining when selection applies. A token rename alone leaves the interaction ambiguous.

Browse a design reference and take one surface or typography rule into your repo. Trace it from the written decision to a shared value to a rendered element. That chain is more useful during review than a long palette with no usage examples.