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

Improve Design Token Story Files #1143

Open
spaceninja opened this issue Mar 10, 2021 · 0 comments
Open

Improve Design Token Story Files #1143

spaceninja opened this issue Mar 10, 2021 · 0 comments
Labels
👷 dev 👷 environment Setup, build tools, configuration, etc.

Comments

@spaceninja
Copy link
Member

Previously, we were using Theo to dynamically generate the Story files for the design tokens. When we switched to Style Dictionary, these files became manually maintained. This wouldn't be bad necessarily, except that there's a lot of code duplication between these files for generating the tables.

Note there is one bit of code that I'd like to DRY up — at the top of most of the design token story files (see src/tokens/*.stories.mdx) there's a repeated bit of code to generate a table of properties. This should ideally be pulled out into a separate file. Unfortunately, when I did so, I got errors about JSX that I wasn't able to quickly resolve. I talked to @calebeby for help, and while we couldn't fix it in the time we had, he mentioned another possibility was converting it to a React component (like ColorPalette)

Minimum acceptance criteria for this ticket is to DRY that code up.

Extra credit would be using Style Dictionary to generate those Story files, as we were doing in Theo. That should be possible, but may be time consuming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👷 dev 👷 environment Setup, build tools, configuration, etc.
Projects
None yet
Development

No branches or pull requests

2 participants