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

Organize color tokens #225

Merged
merged 14 commits into from
Nov 22, 2024
Merged

Organize color tokens #225

merged 14 commits into from
Nov 22, 2024

Conversation

c4rlosviteri
Copy link
Contributor

@c4rlosviteri c4rlosviteri commented Nov 22, 2024

Color Token Organization Improvement

This PR reorganizes color tokens to ensure proper hierarchical display in Figma while maintaining the same token values. The changes focus on two main aspects:

Improved Token Hierarchy

  • Reorganized flat token structures into logical nested hierarchies
  • Tokens now follow the pattern category/component/state instead of category/component-state
  • This change ensures better organization and discoverability in Figma

Clean JSON Structure

  • Removed non-standard properties (docType and docCategory)
  • These properties were not part of the Design Tokens specification
  • Removal ensures clean JSON output for Figma integration

Changes at a glance:

❌ Old: background/accordion-hover
✅ New: background/accordion/hover

Impact

  • No functional changes to token values
  • Better organization in Figma's token panel
  • Cleaner JSON structure
  • Improved maintainability and scalability

Color tokens should be organized to display correctly on Figma. In this PR, I kept the same tokens but improved their organization through proper nesting.

Examples

❌ Old structure - Flat organization

{
  "color": {
    "background": {
      "accordion-hover": { "value": "#F5F5F5" },
      "accordion-active": { "value": "#E0E0E0" },
      "modal-overlay": { "value": "rgba(0, 0, 0, 0.5)" },
      "modal-content": { "value": "#FFFFFF" }
    }
  }
}

✅ New structure - Nested organization

{
  "color": {
    "background": {
      "accordion": {
        "hover": { "value": "#F5F5F5" },
        "active": { "value": "#E0E0E0" }
      },
      "modal": {
        "overlay": { "value": "rgba(0, 0, 0, 0.5)" },
        "content": { "value": "#FFFFFF" }
      }
    }
  }
}

Copy link
Member

@mhewson mhewson left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed overview of the change - looks good

@c4rlosviteri c4rlosviteri merged commit 0135149 into next Nov 22, 2024
2 checks passed
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.

2 participants