Skip to content

feat(tokens): drop-shadow composites, component typography snippets#6161

Open
5t3ph wants to merge 8 commits intomainfrom
seckles/multi-dimension-tokens
Open

feat(tokens): drop-shadow composites, component typography snippets#6161
5t3ph wants to merge 8 commits intomainfrom
seckles/multi-dimension-tokens

Conversation

@5t3ph
Copy link
Copy Markdown
Contributor

@5t3ph 5t3ph commented Apr 9, 2026

Description

This PR improves token tooling in two areas:

  • @adobe/swc-tokens now serializes composite drop-shadow tokens into a single CSS custom property that can be used directly in box-shadow.
  • swc-vscode-token (the extension) now provides snippets for grouped typography tokens, using a type- prefix such as type-component-m-regular.

Will require locally updating the extension from the VSIX file.

Motivation and context

Previous token processing was skipping the composite drop-shadow tokens. Snippets were complementary upgrade to add efficiency to current migration work.

Related issue(s)

SWC-1437

Screenshots (if appropriate)

Snippets will provide the typography related properties as may be exposed for component typography style tokens, visible in Figma within Typography as the "Name" value:
image

Typing type will bring up a list and preview of associated properties:
image

component-snippets.mov

Note: may still need adjusted to expose custom properties on as-needed basis.

Author's checklist

  • I have added automated tests to cover my changes.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Automated tests cover all use cases and follow best practices for writing

Manual review test cases

  • Validate new drop-shadow- tokens present in final stylesheet

    1. Review changes to tokens.css
    2. Ensure valid box-shadow syntax
  • Validate extension updates

    1. Install or update the extension from the VSIX
      • Instructions in 2nd-gen/packages/tools/swc-vscode-token/README.md
      • If updating, you must uninstall, re-install and also reload the window
    2. Ensure token() can access new drop-shadow tokens
    3. Test new snippets by beginning to type type inside of a CSS rule to see suggestions, and test selecting

@5t3ph 5t3ph requested a review from a team as a code owner April 9, 2026 19:54
@5t3ph 5t3ph added CSS Processing Status:Ready for review PR ready for review or re-review. labels Apr 9, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: e71b2ad

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

rgb(0 0 0 / 16%),
rgb(0 0 0 / 48%)
);
--swc-drop-shadow-emphasized:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Example of the source design data

});
}

function normalizeCompositeValue(value, options) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I recommend skipping to the test cases to see the practical results of the changes here (which Chat via Codex assisted me with)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6161

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The point of this file is to auto-generate the type-component-... snippets and expand their properties to correct CSS syntax, as seen in the next file containing the snippets.

@@ -0,0 +1,167 @@
{
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Auto-generated by script in previous file, produces the snippet suggestions/output.

@@ -464,21 +464,21 @@
"y": "2px",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Results of the updated token processing as used by the extension.

Copy link
Copy Markdown
Contributor

@Rajdeepc Rajdeepc left a comment

Choose a reason for hiding this comment

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

Clean extraction and loved how it is shaping up. Before i can give the final approval would you be okay to add these?

  1. a lookupToken test for composite drop-shadow token
  2. Please fix the single quote inconsistency in snippet generation.

@Rajdeepc Rajdeepc self-assigned this Apr 10, 2026
@5t3ph 5t3ph added Status:Ready for re-review PR has had its feedback addressed and is once again ready for review. and removed Status:Ready for review PR ready for review or re-review. labels Apr 10, 2026
@5t3ph 5t3ph requested a review from Rajdeepc April 10, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Processing Status:Ready for re-review PR has had its feedback addressed and is once again ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants