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

JSの生成でアルファ値の情報が落ちないように #35

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

yukukotani
Copy link
Contributor

@yukukotani yukukotani commented Apr 23, 2023

現在指定されている Transform Group js に含まれている color/hex では、アルファ値の情報が落ちてしまう。

そのため、代わりに color/hex8 を使うようにする。Transform Group の上書きはできないみたいなので、Transform Group を使うのはやめて、他の Transform もベタ書きすることにした。

生成される dist/tokens.js の差分は以下の通り。

--- dist/tokens.js	2023-04-23 22:39:21.000000000 +0900
+++ tokens.js	2023-04-23 22:39:05.000000000 +0900
@@ -1,12 +1,12 @@
 /**
  * Do not edit directly
- * Generated on Sun, 23 Apr 2023 13:39:21 GMT
+ * Generated on Sun, 23 Apr 2023 13:39:05 GMT
  */
 
 module.exports = {
   "color": {
     "ubie-black-100": {
-      "value": "#16191f",
+      "value": "#16191f0a",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -23,7 +23,7 @@
       ]
     },
     "ubie-black-200": {
-      "value": "#16191f",
+      "value": "#16191f2e",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -40,7 +40,7 @@
       ]
     },
     "ubie-black-400": {
-      "value": "#16191f",
+      "value": "#16191f7a",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -57,7 +57,7 @@
       ]
     },
     "ubie-black-500": {
-      "value": "#16191f",
+      "value": "#16191fa3",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -74,7 +74,7 @@
       ]
     },
     "ubie-black-700": {
-      "value": "#16191f",
+      "value": "#16191fe5",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -91,7 +91,7 @@
       ]
     },
     "ubie-black-900": {
-      "value": "#16191f",
+      "value": "#16191fff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -108,7 +108,7 @@
       ]
     },
     "ubie-blue-100": {
-      "value": "#f2f6fd",
+      "value": "#f2f6fdff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -125,7 +125,7 @@
       ]
     },
     "ubie-blue-200": {
-      "value": "#cbd3f2",
+      "value": "#cbd3f2ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -142,7 +142,7 @@
       ]
     },
     "ubie-blue-400": {
-      "value": "#6a82d9",
+      "value": "#6a82d9ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -159,7 +159,7 @@
       ]
     },
     "ubie-blue-500": {
-      "value": "#3959cc",
+      "value": "#3959ccff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -176,7 +176,7 @@
       ]
     },
     "ubie-blue-700": {
-      "value": "#263f94",
+      "value": "#263f94ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -193,7 +193,7 @@
       ]
     },
     "ubie-pink-100": {
-      "value": "#fdf2f9",
+      "value": "#fdf2f9ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -210,7 +210,7 @@
       ]
     },
     "ubie-pink-200": {
-      "value": "#f8cfde",
+      "value": "#f8cfdeff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -227,7 +227,7 @@
       ]
     },
     "ubie-pink-400": {
-      "value": "#ea77a1",
+      "value": "#ea77a1ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -244,7 +244,7 @@
       ]
     },
     "ubie-pink-500": {
-      "value": "#da3170",
+      "value": "#da3170ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -261,7 +261,7 @@
       ]
     },
     "ubie-pink-700": {
-      "value": "#a33961",
+      "value": "#a33961ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -278,7 +278,7 @@
       ]
     },
     "ubie-red-100": {
-      "value": "#fcf4f4",
+      "value": "#fcf4f4ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -295,7 +295,7 @@
       ]
     },
     "ubie-red-200": {
-      "value": "#f6d0d0",
+      "value": "#f6d0d0ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -312,7 +312,7 @@
       ]
     },
     "ubie-red-400": {
-      "value": "#ec6d6d",
+      "value": "#ec6d6dff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -329,7 +329,7 @@
       ]
     },
     "ubie-red-500": {
-      "value": "#db3939",
+      "value": "#db3939ff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -346,7 +346,7 @@
       ]
     },
     "ubie-red-700": {
-      "value": "#b02b2b",
+      "value": "#b02b2bff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -363,7 +363,7 @@
       ]
     },
     "ubie-white": {
-      "value": "#ffffff",
+      "value": "#ffffffff",
       "filePath": "tokens/color/primitive.json",
       "isSource": true,
       "original": {
@@ -380,7 +380,7 @@
       ]
     },
     "accent": {
-      "value": "#da3170",
+      "value": "#da3170ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -397,7 +397,7 @@
       ]
     },
     "accent-darken": {
-      "value": "#a33961",
+      "value": "#a33961ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -414,7 +414,7 @@
       ]
     },
     "alert": {
-      "value": "#db3939",
+      "value": "#db3939ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -431,7 +431,7 @@
       ]
     },
     "alert-darken": {
-      "value": "#b02b2b",
+      "value": "#b02b2bff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -448,7 +448,7 @@
       ]
     },
     "background-accent": {
-      "value": "#fdf2f9",
+      "value": "#fdf2f9ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -465,7 +465,7 @@
       ]
     },
     "background-accent-darken": {
-      "value": "#f8cfde",
+      "value": "#f8cfdeff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -482,7 +482,7 @@
       ]
     },
     "background-alert": {
-      "value": "#fcf4f4",
+      "value": "#fcf4f4ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -499,7 +499,7 @@
       ]
     },
     "background-gray": {
-      "value": "#16191f",
+      "value": "#16191f0a",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -516,7 +516,7 @@
       ]
     },
     "background-modal": {
-      "value": "#000000",
+      "value": "#00000080",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -533,7 +533,7 @@
       ]
     },
     "background-primary": {
-      "value": "#f2f6fd",
+      "value": "#f2f6fdff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -550,7 +550,7 @@
       ]
     },
     "background-primary-darken": {
-      "value": "#cbd3f2",
+      "value": "#cbd3f2ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -567,7 +567,7 @@
       ]
     },
     "background-white": {
-      "value": "#ffffff",
+      "value": "#ffffffff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -584,7 +584,7 @@
       ]
     },
     "border": {
-      "value": "#16191f",
+      "value": "#16191f2e",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -601,7 +601,7 @@
       ]
     },
     "overlay": {
-      "value": "#000000",
+      "value": "#00000033",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -618,7 +618,7 @@
       ]
     },
     "primary": {
-      "value": "#3959cc",
+      "value": "#3959ccff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -635,7 +635,7 @@
       ]
     },
     "primary-darken": {
-      "value": "#263f94",
+      "value": "#263f94ff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -652,7 +652,7 @@
       ]
     },
     "text-disabled": {
-      "value": "#16191f",
+      "value": "#16191f2e",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -669,7 +669,7 @@
       ]
     },
     "text-link": {
-      "value": "#3959cc",
+      "value": "#3959ccff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -686,7 +686,7 @@
       ]
     },
     "text-link-sub": {
-      "value": "#16191f",
+      "value": "#16191fa3",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -703,7 +703,7 @@
       ]
     },
     "text-main": {
-      "value": "#16191f",
+      "value": "#16191fe5",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -720,7 +720,7 @@
       ]
     },
     "text-placeholder": {
-      "value": "#16191f",
+      "value": "#16191f7a",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -737,7 +737,7 @@
       ]
     },
     "text-sub": {
-      "value": "#16191f",
+      "value": "#16191fa3",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {
@@ -754,7 +754,7 @@
       ]
     },
     "text-white": {
-      "value": "#ffffff",
+      "value": "#ffffffff",
       "filePath": "tokens/color/semantics.json",
       "isSource": true,
       "original": {

@yukukotani yukukotani self-assigned this Apr 23, 2023
@yukukotani yukukotani changed the title transform js value to color/hex8 JSの生成でアルファ値の情報が落ちないように Apr 23, 2023
Copy link
Contributor

@takanorip takanorip left a comment

Choose a reason for hiding this comment

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

Genius

@yukukotani yukukotani merged commit d0a28ff into main Apr 23, 2023
@yukukotani yukukotani deleted the hex8 branch April 23, 2023 15:10
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