Inheritance

Clone token groups to create derived sets. Inheritance copies structure and values, letting you build variations without repeating definitions.

Basic Inheritance

The /inherit() generator clones a token group, copying its structure and resolved values into a new group.

Why inherit? Instead of duplicating token definitions, inherit from a source and let changes propagate automatically.

Clone a Group

Use /inherit($source) to copy all tokens from another group:

Clone a Group Use /inherit($source) to copy all tokens from another group.

Scope Traversal

Inherit from groups in other scopes using $...ref ellipsis references:

Scope Traversal Inherit from groups in other scopes using $...ref ellipsis references.

Inherit + Transform

Chain /inherit() with pipelines to create derived token sets — like line heights from font sizes or letter spacing from a scale.

Derived Scale

Inherit a modular scale and transform the values to produce a related set:

lineHeights = fontSizes × 1.5, rounded to 8
Derived Scale Inherit a modular scale and transform the values to produce a related set.

Multiple Derived Sets

Inherit the same source multiple times with different transformations:

Two derived sets from a single font scale
Multiple Derived Sets Inherit the same source multiple times with different transformations.

Deep Inheritance

Inheritance copies nested structures recursively. The entire tree of tokens is cloned, preserving all levels.

Deep Inheritance Inherit a group containing sub-groups — the full hierarchy is preserved.

Pipelines After Inherit

Any pipeline operator can follow /inherit() — transform, round, override, rename. They apply to the inherited values.

Pipelines After Inherit Inherit a scale, transform all values, then override specific tokens for exceptions.

Key features: Clones structure, copies final values (after pipelines), supports $...ref for scope traversal, and preserves token types.

Next: Color Generators — create color palettes with harmony, scale, and contrast generators.