Skip to content

Theme: Add design tokens maintainer's guide documentation#79157

Merged
aduth merged 12 commits into
trunkfrom
add/theme-tokens-maintainers-guide
Jun 18, 2026
Merged

Theme: Add design tokens maintainer's guide documentation#79157
aduth merged 12 commits into
trunkfrom
add/theme-tokens-maintainers-guide

Conversation

@aduth

@aduth aduth commented Jun 12, 2026

Copy link
Copy Markdown
Member

What?

Related: #79032 (comment)

Adds a new README.md within the tokens/ directory of the @wordpress/theme package to serve as a maintainer's guide for the WordPress Design System design tokens.

Why?

  • Adds additional context for how tokens are maintained which has been undocumented until now:
    • The difference between primitive and semantic tokens and why they exist the way they do
    • Explicit support for Figma variables import, including $extensions['com.figma.scopes'] and where to find information about maintaining those values
  • Improves the relevance of the package's root README.md to include information about how to use the theme package. Most people shouldn't care about the existence of tokens/color.json and how these files are structured, for example.
  • Avoids a confusing dead-end if someone were to link to the packages/themes/tokens directory. This would be reasonable to do as it is the source of truth for the design system's design tokens, but currently it lacks any documentation context around what that directory is for if someone arrives there directly.

How?

  • Adds new packages/theme/tokens/README.md
  • Shifts "Structure" and "Token Naming" sub-sections of the root README.md into this new file
  • Maintains existing "Design Tokens" section of the root README.md and adds a link to this new document for more information

Testing Instructions

Review updated documentation for relevance and accuracy.

Use of AI Tools

No AI was used.

@aduth aduth requested a review from a team as a code owner June 12, 2026 15:17
@aduth aduth added [Type] Developer Documentation Documentation for developers Design System Issues related to the system of combining components according to best practices. [Package] Theme /packages/theme labels Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aduth <[email protected]>
Co-authored-by: shail-mehta <[email protected]>
Co-authored-by: ciampo <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Flaky tests detected in af0d860.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27717062397
📝 Reported issues:

Comment thread packages/theme/tokens/README.md Outdated
Comment thread packages/theme/tokens/README.md
Comment thread packages/theme/tokens/README.md
Comment thread packages/theme/tokens/README.md
Comment thread packages/theme/tokens/README.md Outdated

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good overall 🚀

Left some additional feedback, but feel free to merge once addressed

Comment thread packages/theme/tokens/README.md
Comment thread packages/theme/README.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now noticing that this document has a h2 Design Tokens (linking to the separate doc) and also an h3 Design Tokens section . Is this another opportunity for consolidation / removal of duplicated content?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great catch, especially since it's literally in the same hierarchy 😂 🤦 (Theme > Design Tokens > Design Tokens). I consolidated in 62dbe35.

Comment thread packages/theme/tokens/README.md Outdated

Design tokens are the visual design atoms of a design system. They are named entities that store visual design attributes like colors, spacing, typography, and shadows. They serve as a single source of truth that bridges design and development, ensuring consistency across platforms and making it easy to maintain and evolve the visual language of an application.

Components that use these design tokens benefit from the consistency they guarantee with other components that extend from the same system. Future theming improvements or configurations like color theming (or "dark mode"), density, or roundness will cascade automatically to these components without any additional effort on the part of the component maintainer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Density is not a tweakable aspect of the theme anymore; we should remove all mentions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Density is not a tweakable aspect of the theme anymore; we should remove all mentions

Yeah I mentioned it in regards to general configurability as something we could do (and AFAIK still have ambitions to do), and even tying it to "Future" as the first word of the sentence, but happy to remove if it risks confusion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Density is not a tweakable aspect of the theme anymore; we should remove all mentions

Removed density references in 72c2bd7.

Comment thread packages/theme/tokens/README.md Outdated
--wpds-dimension-padding-xs: 4px;
```

Someone using the design system should never see or concern themselves with either the `primitive.space.10` token or the underlying 4 pixel base unit. This also enables the design system to alter these values based on factors like density, which could affect the value of the primitive token and cascade automatically to the CSS properties.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the mention of density here, too.

Also, the "cascading" part here is slightly redundant after the recent addition of the paragraph at line 5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the mention of density here, too.

Also, the "cascading" part here is slightly redundant after the recent addition of the paragraph at line 5

I removed this entire sentence as part of 72c2bd7. And then built upon the paragraph in 49e31e7 with a more concrete example of how someone could think about semantics (swapped padding example with element size).

@aduth aduth force-pushed the add/theme-tokens-maintainers-guide branch from f27353d to af0d860 Compare June 17, 2026 20:17
@aduth aduth merged commit 2c2a3f9 into trunk Jun 18, 2026
44 checks passed
@aduth aduth deleted the add/theme-tokens-maintainers-guide branch June 18, 2026 12:59
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Design System Issues related to the system of combining components according to best practices. [Package] Theme /packages/theme [Type] Developer Documentation Documentation for developers

Projects

Status: 💫 Done

Development

Successfully merging this pull request may close these issues.

3 participants