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

[WNMGDS-2667] Separate color utils into their own module and add to them #2945

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

pwolfert
Copy link
Contributor

Summary

WNMGDS-2667

I've separated these changes to make the next PRs less noisy. The color utils are generally useful by many different modules, but the other utils in this file were specific to the token export. I'm separating color utils into their own module and adding some things that will be used by our Figma-syncing code.

How to test

Should be able to do all the token stuff and build the doc site without any problems.

Checklist

  • Prefixed the PR title with the Jira ticket number as [WNMGDS-####] Title or [NO-TICKET] if this is unticketed work.
  • Selected appropriate Type (only one) label for this PR, if it is a breaking change, label should only be Type: Breaking
  • Selected appropriate Impacts, multiple can be selected.
  • Selected appropriate release milestone

We reference these utils in several places, and we'll be adding figma syncing modules to that list, and they don't need the other utils that aren't related to color
@pwolfert pwolfert added Type: Internal This item relates to internal tooling/maintenance Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. labels Feb 20, 2024
@pwolfert pwolfert added this to the 10.0.0-beta.1 milestone Feb 20, 2024
@pwolfert pwolfert requested a review from zarahzachz February 20, 2024 21:38
Copy link
Collaborator

@zarahzachz zarahzachz left a comment

Choose a reason for hiding this comment

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

looks good. one small comment

}

export function rgbToHex({ r, g, b, a }: RgbaObject) {
if (a === undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you remove this conditional by setting a default value in the argument? export function rgbToHex({ r, g, b, a = 1 }: RgbaObject) {}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a good change. This came verbatim from Figma's example project

@pwolfert pwolfert merged commit cd28b73 into main Feb 21, 2024
1 check passed
@pwolfert pwolfert deleted the pwolfert/figma-tokens-1-color-utils branch February 21, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. Type: Internal This item relates to internal tooling/maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants