Skip to content

Conversation

@jkuelz
Copy link
Member

@jkuelz jkuelz commented Oct 21, 2025

Description

This change introduces reference tokens for primary, neutral, and status colors into our design token system. This is one of a series of updates to implement better out of the box global theming. We are keeping the legacy tokens for now so that we don't break our internal package builds which still rely on them in the meantime. Because we are keeping both tokens, this update also adds an eslint rule to tell developers to use the new tokens if the old ones are referenced.

Related links, issue #, if available: [quip: ac9YAbqsd7e6], CR-229486129

How has this been tested?

Ran through dev pipeline: AwsUi-v3-jkuelz

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@jkuelz jkuelz requested a review from a team as a code owner October 21, 2025 06:42
@jkuelz jkuelz requested review from SpyZzey and just-boris and removed request for a team October 21, 2025 06:42
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.17%. Comparing base (ce1d9d9) to head (5bb6e72).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3952   +/-   ##
=======================================
  Coverage   97.17%   97.17%           
=======================================
  Files         854      854           
  Lines       24985    24985           
  Branches     8802     8802           
=======================================
  Hits        24278    24278           
  Misses        659      659           
  Partials       48       48           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@just-boris just-boris left a comment

Choose a reason for hiding this comment

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

Approved, the suggestions about eslint rule can be a follow up

module.exports.rules = {
'ban-files': require('./ban-files'),
'prefer-live-region': require('./prefer-live-region'),
'no-legacy-tokens': require('./no-legacy-tokens'),
Copy link
Member

Choose a reason for hiding this comment

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

Good idea to add a linter rule, but could you add it via a PR to another repository: https://github.com/cloudscape-design/build-tools/tree/main/src/eslint

And while adding this, it also needs some tests for positive and negative matches. There are some examples already

Comment on lines +29 to +40
const matches = node.value.match(LEGACY_TOKEN_PATTERN);
if (matches) {
matches.forEach(token => {
const colorFamily = token.match(/color(Grey|Blue|Green|Red|Yellow)/)?.[1];
const suggestion = REFERENCE_TOKEN_SUGGESTIONS[`color${colorFamily}`] || 'semantic reference tokens';

context.report({
node,
messageId: 'no-legacy-tokens',
data: { token, suggestion },
});
});
Copy link
Member

Choose a reason for hiding this comment

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

This code is repeated two times and can be reused, right?

Copy link
Member

@NathanZlion NathanZlion left a comment

Choose a reason for hiding this comment

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

Other than the reviews that @just-boris left, LGTM.

@jkuelz jkuelz added this pull request to the merge queue Oct 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 21, 2025
@jkuelz jkuelz added this pull request to the merge queue Oct 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 21, 2025
@jkuelz jkuelz added this pull request to the merge queue Oct 21, 2025
Merged via the queue into main with commit 4806683 Oct 21, 2025
48 checks passed
@jkuelz jkuelz deleted the jkuelz-reference-tokens branch October 21, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants