Add support for "full width" (100%) property
Overview
This PR adds support for the "full width" property, allowing users to apply sizing or dimension tokens with a value of "100%" to enhance layout flexibility.
Implementation Details
When a token with a value of "100%" is applied to a layer's width property:
-
For auto layout children: Sets
layoutAlignto "STRETCH", making the element automatically fill the parent's width - For regular layers: Sets the width to match the parent element's width
- Fallback behavior: If no suitable parent is found, handles the value like a regular sizing token
Example Use Cases
- Design tokens defined with
width: "100%"can be used to create responsive layouts - A common token can be applied across different hierarchy levels with context-aware behavior
Testing
- Added unit tests covering all behavior patterns:
- Normal width values
- 100% width in auto layout parents
- 100% width in regular parents
- Fallback behavior
- Verified no regression in existing functionality
Fixes #3377.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
- Triggering command:
/usr/bin/fwupdmgr refresh(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🦋 Changeset detected
Latest commit: 62bb377c1c563f3af3f2355c76dba41fbc589d20
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @tokens-studio/figma-plugin | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Commit SHA:5e4542ef76a4e5e4dc7f6f9468eec02ce8d38297
Test coverage results :test_tube:
Code coverage diff between base branch:main and head branch: copilot/fix-3377
| Status | File | % Stmts | % Branch | % Funcs | % Lines |
|---|---|---|---|---|---|
| :green_circle: | total | 65.39 (0.1) | 57.27 (0.27) | 62.54 (0.02) | 65.74 (0.11) |
| :green_circle: | packages/tokens-studio-for-figma/src/plugin/applySizingValuesOnNode.ts | 90.19 (40.19) | 76.47 (30.57) | 100 (0) | 90.19 (40.19) |
| :green_circle: | packages/tokens-studio-for-figma/src/utils/isAutoLayout.tsx | 100 (0) | 100 (50) | 100 (0) | 100 (0) |
the logic you have right now for applying it - it repeats between width and height - lets extract to a function to call on both, with either width or height. like right now you have it in 3 places, bu...
Refactored the duplicated logic into a shared helper function handleFullSizeValue that handles 100% values for width, height, and both dimensions. The function consolidates the repeated logic across all three sections and includes proper TypeScript type guards. Commit 24b15c0.
⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁
