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

chore(spindle-tokens): export design token with Figma variables #1067

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

herablog
Copy link
Member

@herablog herablog commented Sep 11, 2024

デザイントークンの書き出し元をFigma StylesからFigma Variablesに変更しました。それに伴いトークンの形式をDesign Tokens Community Group specに変更しています。

※ style-dictionary v4で対応してたのでちょうどよかった :js_peace:

大まかな対応は以下の通りです

  • style-dictionary v4にアップデート
  • export scriptの作成
  • Figma Stylesのexportに使っていた@figma-exportの削除

@herablog herablog self-assigned this Sep 11, 2024
@herablog herablog force-pushed the chore/style-dictionary-v4 branch 2 times, most recently from ef1c7c0 to afdd2c2 Compare September 12, 2024 07:47
@herablog herablog changed the title chore: update dependency style-dictionary to v4 chore(spindle-tokens): export design token with Figma variables Sep 12, 2024
files: [
{
destination: 'dist/json/spindle-tokens.json',
format: 'json',
destination: 'dist/css/spindle-tokens-animation.css',
Copy link
Member Author

@herablog herablog Sep 12, 2024

Choose a reason for hiding this comment

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

書き出しは今使われている設定に合わせます。(allは作ってないですが)

ref: https://unpkg.com/browse/@openameba/[email protected]/dist/css/

Copy link
Contributor

Choose a reason for hiding this comment

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

それでいうとallは対応しないんです?

Copy link
Member Author

Choose a reason for hiding this comment

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

使ってるのかなぁと形式変わっちゃうしなぁの2点で作ってないですが、作ることもできます〜

@@ -0,0 +1,137 @@
{
Copy link
Member Author

Choose a reason for hiding this comment

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

こりはテスト用のサンプルレスポンスです

@@ -0,0 +1,101 @@
{
"Drop Shadow": {
Copy link
Member Author

Choose a reason for hiding this comment

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

ShadowはFigmaから書き出すよさが今の所ないので、手動で作ってます。

@herablog herablog marked this pull request as ready for review September 12, 2024 09:27
files: [
{
destination: 'dist/json/spindle-tokens.json',
format: 'json',
destination: 'dist/css/spindle-tokens-animation.css',
Copy link
Contributor

Choose a reason for hiding this comment

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

それでいうとallは対応しないんです?

}

export function transformPrimitiveColor(variables: GetLocalVariablesResponse) {
const primitiveColorCollections = Object.values(
Copy link
Contributor

Choose a reason for hiding this comment

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

variables.meta.variableCollections のエラーハンドリングあってもいいかなと思ったんですけど。
token配信してエラーになるケース。ないですよね。大丈夫か。

Copy link
Member Author

Choose a reason for hiding this comment

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

export -> PRで確認 -> CSSにして配信 というフローなので大丈夫そうですがどうでしょか!

Copy link
Contributor

Choose a reason for hiding this comment

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

大丈夫そうですね。OKす。

transformAnimationProperty,
} from '../lib/animation-transformer';

const FIGMA_FILE_KEY = 'st60hCtXaGsXQCnCwNS9Dy';
Copy link
Contributor

Choose a reason for hiding this comment

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

このキーって見えてて大丈夫なものなんです?
(イマイチわかってない)

Copy link
Member Author

@herablog herablog Sep 13, 2024

Choose a reason for hiding this comment

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

@MasatoHonda 確認済みです! #1102 でも埋め込んでます〜 (URLの一部です)

@herablog herablog force-pushed the chore/style-dictionary-v4 branch from c0946e3 to 3c21d90 Compare October 10, 2024 08:29
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.

2 participants