Theme: Add design tokens maintainer's guide documentation#79157
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in af0d860. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27717062397
|
ciampo
left a comment
There was a problem hiding this comment.
Looking good overall 🚀
Left some additional feedback, but feel free to merge once addressed
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
That's a great catch, especially since it's literally in the same hierarchy 😂 🤦 (Theme > Design Tokens > Design Tokens). I consolidated in 62dbe35.
|
|
||
| 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. |
There was a problem hiding this comment.
Density is not a tweakable aspect of the theme anymore; we should remove all mentions
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Density is not a tweakable aspect of the theme anymore; we should remove all mentions
Removed density references in 72c2bd7.
| --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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
We should remove the mention of
densityhere, 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).
Co-authored-by: Shail Mehta <[email protected]>
Co-authored-by: Marco Ciampini <[email protected]>
Co-authored-by: Marco Ciampini <[email protected]>
Duplicative of the "Primitive and Semantic Tokens" section in the new tokens/README.md
Also aligns better with how we refernce "Design Tokens Reference" in preceding sentence
f27353d to
af0d860
Compare
What?
Related: #79032 (comment)
Adds a new
README.mdwithin thetokens/directory of the@wordpress/themepackage to serve as a maintainer's guide for the WordPress Design System design tokens.Why?
$extensions['com.figma.scopes']and where to find information about maintaining those valuesREADME.mdto include information about how to use the theme package. Most people shouldn't care about the existence oftokens/color.jsonand how these files are structured, for example.packages/themes/tokensdirectory. 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?
packages/theme/tokens/README.mdTesting Instructions
Review updated documentation for relevance and accuracy.
Use of AI Tools
No AI was used.