Skip to content

Theme: Add Figma scopes to element size tokens#79032

Merged
jameskoster merged 2 commits into
trunkfrom
add/figma-scopes-size-tokens
Jun 10, 2026
Merged

Theme: Add Figma scopes to element size tokens#79032
jameskoster merged 2 commits into
trunkfrom
add/figma-scopes-size-tokens

Conversation

@jameskoster

Copy link
Copy Markdown
Contributor
Screenshot 2026-06-09 at 09 19 40

Follow up to #76545.

What

Adds com.figma.scopes of WIDTH_HEIGHT to the wpds-dimension.size.* element size tokens (5xs through lg) in packages/theme/tokens/dimension.json.

Why

Without a Figma scope defined as an $extensions entry, these tokens aren't surfaced as size options in Figma's variable pickers when designers are sizing layers.

Adding the WIDTH_HEIGHT scope makes them importable and selectable in the appropriate context, consistent with how the existing surface-width tokens are scoped.

How

  • Added an $extensions block with "com.figma.scopes": [ "WIDTH_HEIGHT" ] to each of the eight size tokens, mirroring the established pattern already used by surface-width.
  • No value or naming changes — purely additive metadata, so there is no impact on the generated CSS custom properties or any consuming code.

Testing Instructions

  1. Import packages/theme/tokens/dimension.json into Figma.
  2. Confirm the wpds-dimension/size/* variables import with the WIDTH_HEIGHT scope applied.
  3. When sizing a layer (width/height), confirm the size tokens are offered in the variable picker.

Note

Unfortunately Figma's scoping system doesn't support targeting height or width individually, only both together, so despite it not matching their intended purpose it will be possible to assign size tokens to widths in Figma.

Add `com.figma.scopes` of `WIDTH_HEIGHT` to the `wpds-dimension.size`
tokens so they can be imported into Figma and offered when sizing
layers, matching the existing `surface-width` tokens.

Co-authored-by: Cursor <[email protected]>
@jameskoster jameskoster requested a review from a team as a code owner June 9, 2026 08:20
@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Design System Issues related to the system of combining components according to best practices. [Package] Theme /packages/theme labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 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: jameskoster <[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.

Document the WIDTH_HEIGHT Figma scopes added to --wpds-dimension-size-* tokens in #79032.

Co-authored-by: Cursor <[email protected]>
@jameskoster jameskoster enabled auto-merge (squash) June 10, 2026 10:19
@jameskoster jameskoster merged commit 2e1dd9b into trunk Jun 10, 2026
41 of 43 checks passed
@jameskoster jameskoster deleted the add/figma-scopes-size-tokens branch June 10, 2026 10:48
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 10, 2026
@aduth

aduth commented Jun 10, 2026

Copy link
Copy Markdown
Member

Aside: We should document how we're using Figma scopes in these token source files. At the very least it would be a useful resource to point to https://developers.figma.com/docs/plugins/api/VariableScope/ as the reference of what's available.

@aduth

aduth commented Jun 12, 2026

Copy link
Copy Markdown
Member

Aside: We should document how we're using Figma scopes in these token source files. At the very least it would be a useful resource to point to https://developers.figma.com/docs/plugins/api/VariableScope/ as the reference of what's available.

Follow-up: #79157

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] Enhancement A suggestion for improvement.

Projects

Status: 💫 Done

Development

Successfully merging this pull request may close these issues.

3 participants