Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify color namespace and update transformations to Figma and style system outputs #4654

Merged
merged 18 commits into from
Jan 15, 2025

Conversation

taysea
Copy link
Collaborator

@taysea taysea commented Jan 10, 2025

Deploy Preview

What does this PR do?

This PR makes significant changes to our token translations, specifically prompted by our new direction for color naming.

Goals for these changes:

  1. Maintain alignment with Design Token community group spec
  2. Allow for improved flexibility in our color system while also:
    a. Minimizing chance of near-term breaking changes
    b. Maximizing designer and dev experience by keeping color names as brief as possible
    c. Maintaining parity across design and dev

Diagram to illustrate translations
The below diagram illustrates how we manage these translations, with the summary being:

  1. The design token files in tokens/ serve as the source of truth and are structure in alignment with the design token community group spec (DTCG)
  2. The terms "DEFAULT" and "REST" are special keys that appear in the tokens/ files to stay in alignment with nested structure DTCG
  3. When we push to Figma, we remove DEFAULT, REST and hyphenate (flatten) color names
  4. When we pull from Figma, we add back DEFAULT, REST
  5. When we push to style system outputs (e.g., css variables, etc.), we remove DEFAULT, REST
Screenshot 2025-01-10 at 12 09 44 PM

Other modifications

In addition, this PR supersedes #4644, as it was easier to include the work here.

Where should the reviewer start?

The commits in this PR have been separated to make review easier, tackling different aspects of the work in chunks. I would recommend reviewing commit by commit.

What testing has been done on this PR?

In addition to the feature you are implementing, have you checked the following:

General UX Checks

  • Small, medium, and large screen sizes
  • Cross-browsers (FireFox, Chrome, and Safari)
  • Light & dark modes
  • All hyperlinks route properly

Accessibility Checks

  • Keyboard interactions
  • Screen reader experience
  • Run WAVE accessibility plugin (Chrome)

Code Quality Checks

  • Console is free of warnings and errors
  • Passes E2E commit checks
  • Visual snapshots are reasonable

How should this be manually tested?

Any background context you want to provide?

What are the relevant issues?

Closes #4656
Closes #4288

Screenshots (if appropriate)

Should this PR be mentioned in Design System updates?

Is this change backwards compatible or is it a breaking change?

Copy link

changeset-bot bot commented Jan 10, 2025

🦋 Changeset detected

Latest commit: 8055908

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
hpe-design-tokens Minor

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

@taysea taysea requested a review from halocline January 10, 2025 20:16
Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for unrivaled-bublanina-3a9bae ready!

Name Link
🔨 Latest commit 8055908
🔍 Latest deploy log https://app.netlify.com/sites/unrivaled-bublanina-3a9bae/deploys/6788202a1c9c3d000842ae38
😎 Deploy Preview https://deploy-preview-4654--unrivaled-bublanina-3a9bae.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "Node16",
"target": "es2015",
"target": "ES2021",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI -- this change is to be able to use .replaceAll() string function.

/**
* Supported color interaction states
*/
const interactions = ['hover', 'focus', 'active'];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI -- having to define these interactions/prominences/exceptions here is not ideal, but I feel it's sufficient for the time being. Something we can come back to refine in future.

@@ -298,7 +298,7 @@
"xxsmall": {
"$type": "number",
"$value": "{static.container.xxsmall}",
"$description": "Container tokens define the minimum/maximum width and height of containers or layout elements. For example, box, card and grids.",
"$description": "Use to define the minimum/maximum width and height of containers or layout elements. For example, box, card and grids.",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI -- No changes in this PR affected this, but rather the descriptions between the "medium" and "small" mode in our Github files had gotten out of sync. When pulling from Figma in this PR, this will align the descriptions.

@taysea taysea marked this pull request as draft January 10, 2025 22:21
@taysea taysea marked this pull request as ready for review January 15, 2025 01:58
@taysea taysea marked this pull request as draft January 15, 2025 02:02
@taysea taysea marked this pull request as ready for review January 15, 2025 02:05
@taysea taysea merged commit 2b30ef4 into master Jan 15, 2025
8 of 9 checks passed
@taysea taysea deleted the color-namespace branch January 15, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants