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

Automate CSS Color Variable Generation from Figma JSON with Style Dictionary #662

Open
georgewrmarshall opened this issue Apr 23, 2024 · 0 comments · May be fixed by #720
Open

Automate CSS Color Variable Generation from Figma JSON with Style Dictionary #662

georgewrmarshall opened this issue Apr 23, 2024 · 0 comments · May be fixed by #720
Assignees
Labels
team-design-system All issues relating to design system

Comments

@georgewrmarshall
Copy link
Collaborator

Description

To enhance the efficiency and consistency of our design system implementation, we propose the automation of CSS variable generation using Style Dictionary, directly from our design tokens defined in Figma JSON. This initiative aims to streamline the process of updating and maintaining our design tokens, ensuring that changes in Figma are automatically reflected in our codebase as CSS variables. By automating this workflow, we can reduce manual errors, save development time, and ensure a seamless alignment between our design and development environments.

Technical Details

  • Objective: Set up an automated workflow using Style Dictionary to generate CSS variables from design tokens exported as JSON from Figma.
  • Implementation Steps:
    1. Export the current design tokens from Figma as JSON, ensuring all necessary tokens are accurately defined.
    2. Set up Style Dictionary in our design tokens repository, configuring it to process the Figma JSON file.
    3. Define a transformation within Style Dictionary to convert design tokens into CSS variables, considering naming conventions and theming structures.
    4. Implement an automated workflow (e.g., GitHub Actions) that triggers the Style Dictionary process upon updates to the Figma JSON file.
    5. Test the automated generation of CSS variables to ensure accuracy and consistency with the design tokens defined in Figma.
  • Dependencies: Access to the Figma project, familiarity with Style Dictionary, and permissions to set up automated workflows in the repository.

Acceptance Criteria

  • Design tokens defined in Figma can be automatically exported as JSON and processed by Style Dictionary to generate CSS variables.
  • The generated CSS variables accurately reflect the design tokens defined in Figma, maintaining naming conventions and theming structures.
  • An automated workflow is in place, triggering the generation of CSS variables upon updates to the design tokens in Figma.
  • The development team can easily integrate and use the generated CSS variables in the codebase, enhancing the alignment with the design system.
  • Documentation is updated to include the new automated workflow, guiding contributors on how to make design token changes in Figma and how they are reflected in the codebase.

Additional Notes

This automation represents a significant step towards bridging the gap between our design and development processes. By leveraging Style Dictionary and the power of automation, we can ensure that our design system remains dynamic, scalable, and tightly integrated with our development efforts.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system label Apr 23, 2024
@georgewrmarshall georgewrmarshall self-assigned this Apr 23, 2024
@garrettbear garrettbear changed the title Automate CSS Variable Generation from Figma JSON with Style Dictionary Automate CSS Color Variable Generation from Figma JSON with Style Dictionary Apr 25, 2024
@brianacnguyen brianacnguyen linked a pull request Jun 3, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-design-system All issues relating to design system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants