Skip to content

Conversation

@didoo
Copy link
Contributor

@didoo didoo commented Dec 2, 2025

📌 Summary

Small PR that fixes some format inconsistencies for the "motion" Carbon tokens

🛠️ Detailed description

In this PR I have:

  • updated the logic that converts the Carbon duration value to the DTCG format to always use seconds
  • updated logic that converts the Carbon cubic-bezier value to the expected DTCG format
  • re-extracted the Carbon tokens in their src files

🔗 External links

Jira ticket: https://hashicorp.atlassian.net/browse/HDS-5671


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@didoo didoo requested a review from a team as a code owner December 2, 2025 22:07
@vercel
Copy link

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Dec 2, 2025 10:07pm
hds-website Ready Ready Preview Dec 2, 2025 10:07pm

Copy link
Contributor

Copilot AI left a comment

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 standardizes the format of Carbon motion tokens to align with DTCG (Design Tokens Community Group) specifications. The changes ensure consistent representation of animation easing functions and durations across the design system.

Key changes:

  • Converted cubic-bezier type from cubic-bezier to cubicBezier and transformed values from CSS function format to array format
  • Standardized all duration values to use seconds instead of milliseconds
  • Re-extracted Carbon tokens with the updated conversion logic

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/tokens/src/carbon-extracted/motion/easings.json Updated easing token types and values to DTCG-compliant format
packages/tokens/src/carbon-extracted/motion/durations.json Converted duration values from milliseconds to seconds
packages/tokens/scripts/extract-carbon-parts/convertObjectToDtcgFormat.ts Added conversion logic for cubic-bezier and duration standardization


function convertCubicBezierValue(value: string) {
// eg. `cubic-bezier(0.2, 0, 0.38, 0.9)`
const match = value.match(/^cubic-bezier\((.*)\)$/);
Copy link
Contributor

@KristinLBradley KristinLBradley Dec 3, 2025

Choose a reason for hiding this comment

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

This seems a bit broad in what it matches in the parenthesis, but I don't know if that's a real concern.

Copy link
Contributor

@KristinLBradley KristinLBradley 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 to me. I just added one minor question.

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.

3 participants