cloudfour / cloudfour/cloudfour.com-patterns

Improve Design Token Story Files

オープン
#1,143 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
:construction_worker: dev 👷 environment
主要言語
SCSS
スター
26
フォーク
3
平均マージ
19時間 32分
マージ済み PR(30日)
81

説明

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.

- [Old Theo Story Template](https://github.com/cloudfour/cloudfour.com-patterns/blob/2e00bb2893e22df5e105b1c7da58eb221bdfdea1/.theo/formats/stories.mdx.js)
- [Style Dictionary: Using a template to create a format](https://amzn.github.io/style-dictionary/#/formats?id=using-a-template-templating-engine-to-create-a-format)
- [Style Dictionary example of custom formats using templates](https://github.com/amzn/style-dictionary/tree/master/examples/advanced/custom-formats-with-templates)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。