Skip to content

Add validation for deprecated design tokens#324782

Merged
mrleemurray merged 1 commit into
mainfrom
mrleemurray/joyous-bronze-meadowlark
Jul 7, 2026
Merged

Add validation for deprecated design tokens#324782
mrleemurray merged 1 commit into
mainfrom
mrleemurray/joyous-bronze-meadowlark

Conversation

@mrleemurray

@mrleemurray mrleemurray commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the design token validation logic to align with the latest naming conventions and adds a new check for deprecated token usage. The most significant changes are the renaming of several font size and weight tokens to their new generic forms, and the introduction of a linter that detects and reports deprecated tokens, suggesting their replacements. The summary reporting at the end of the stylelint run now also includes a count of deprecated token findings.

Design token naming updates:

  • Updated font size and weight token suggestions in validateDesignTokens.ts to use the new --vscode-fontSize-* and --vscode-fontWeight-* variables instead of the old --vscode-agents-* and --vscode-bodyFontSize* variables. This affects the mapping, comments, and violation messages. [1] [2] [3] [4] [5]

Deprecated token detection:

  • Added a new function validateDeprecatedTokens in validateDesignTokens.ts that scans for usages of deprecated design tokens and reports them with suggested replacements.
  • Integrated validateDeprecatedTokens into the stylelint pipeline in build/stylelint.ts, so deprecated token usage is now detected and reported during linting. [1] [2]

Reporting improvements:

  • Added a new deprecated category to the design token summary counts and included it in the final summary output. [1] [2] [3]

Copilot AI review requested due to automatic review settings July 7, 2026 15:56
@mrleemurray mrleemurray enabled auto-merge (squash) July 7, 2026 15:56
@mrleemurray mrleemurray self-assigned this Jul 7, 2026

Copilot AI 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.

Pull request overview

This PR extends the build-time stylelint design-token validation with a new check that flags usage of deprecated --vscode-bodyFontSize* tokens and suggests their current replacements. It wires the new validateDeprecatedTokens validator into the gulp stylelint task (including its own summary tally/footer category), and it retargets the existing font-size and font-weight suggestions from the agents--prefixed ramp to the generic --vscode-fontSize-* / --vscode-fontWeight-* ramp, updating the accompanying comments accordingly.

The deprecation mapping is correct and matches the @deprecated annotations in src/vs/platform/theme/common/sizes/baseSizes.ts and the design-tokens instructions doc. The one point worth a human decision: these validators run by default on src/vs/sessions/**, where the surrounding CSS and the sessions ramp table in design-tokens.instructions.md use the agents--prefixed variants, so switching the ramp/weight suggestions to the generic tokens introduces a convention inconsistency in that area.

Changes:

  • Add validateDeprecatedTokens to detect deprecated --vscode-bodyFontSize* vars and suggest replacements, with prefix-boundary handling to avoid double-reporting.
  • Integrate the new validator into build/stylelint.ts (findings collection, deprecated count category, and footer summary).
  • Retarget FONT_SIZE_RAMP and the font-weight suggestion from --vscode-agents-fontSize-*/--vscode-agents-fontWeight-* to the generic --vscode-fontSize-*/--vscode-fontWeight-* tokens (plus comment wording updates).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
build/lib/stylelint/validateDesignTokens.ts Adds the validateDeprecatedTokens validator and deprecated-token map; retargets font-size/weight suggestions to generic tokens and refreshes comments.
build/stylelint.ts Imports and runs the new validator, adds the deprecated category to the tally, total, and summary footer.

Comment thread build/lib/stylelint/validateDesignTokens.ts
Comment thread build/lib/stylelint/validateDesignTokens.ts
@mrleemurray mrleemurray merged commit 6ed31a3 into main Jul 7, 2026
30 checks passed
@mrleemurray mrleemurray deleted the mrleemurray/joyous-bronze-meadowlark branch July 7, 2026 17:20
@vs-code-engineering vs-code-engineering Bot added this to the 1.129.0 milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants