Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Feat/design tokens upgrade (#18051)

Jonathan Summers-Muir171714965ec5
diff --git a/package-lock.json b/package-lock.json
index 4ab022be6d3..54a500df299 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3235,6 +3235,15 @@
"node": ">=4.0.0"
}
},
+ "node_modules/@ctrl/tinycolor": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
+ "integrity": "sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/@dagrejs/dagre": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@dagrejs/dagre/-/dagre-1.0.2.tgz",
@@ -41526,6 +41535,7 @@
"@babel/preset-flow": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4",
+ "@ctrl/tinycolor": "^3.4.0",
"@storybook/addon-actions": "^7.0.5",
"@storybook/addon-controls": "^7.0.26",
"@storybook/addon-docs": "^7.0.26",
diff --git a/packages/ui/build/css/global.css b/packages/ui/build/css/global.css
deleted file mode 100644
index f628990e179..00000000000
--- a/packages/ui/build/css/global.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * Do not edit directly
- * Generated on Fri, 23 Jun 2023 11:09:36 GMT
- */
-
-:root {
- --colors-black: #000000;
- --colors-white: #ffffff;
- --colors-gray-dark-1: #161616; /* 161616 */
- --colors-gray-dark-2: #1c1c1c; /* 1C1C1C */
- --colors-gray-dark-3: #232323; /* 232323 */
- --colors-gray-dark-4: #282828; /* 282828 */
- --colors-gray-dark-5: #2e2e2e; /* 2E2E2E */
- --colors-gray-dark-6: #343434; /* 343434 */
- --colors-gray-dark-7: #3e3e3e; /* 3E3E3E */
- --colors-gray-dark-8: #505050; /* 505050 */
- --colors-gray-dark-9: #707070; /* 707070 */
- --colors-gray-dark-10: #7e7e7e; /* 7E7E7E */
- --colors-gray-dark-11: #a0a0a0; /* A0A0A0 */
- --colors-gray-dark-12: #ededed; /* EDEDED */
- --colors-gray-dark-alpha-1: #00000000; /* 000000 */
- --colors-gray-dark-alpha-2: #ffffff08; /* FFFFFF */
- --colors-gray-dark-alpha-3: #ffffff0f; /* FFFFFF */
- --colors-gray-dark-alpha-4: #ffffff14; /* FFFFFF */
- --colors-gray-dark-alpha-5: #ffffff1a; /* FFFFFF */
- --colors-gray-dark-alpha-6: #ffffff21; /* FFFFFF */
- --colors-gray-dark-alpha-7: #ffffff2b; /* FFFFFF */
- --colors-gray-dark-alpha-8: #ffffff40; /* FFFFFF */
- --colors-gray-dark-alpha-9: #ffffff63; /* FFFFFF */
- --colors-gray-dark-alpha-10: #ffffff73; /* FFFFFF */
- --colors-gray-dark-alpha-11: #ffffff96; /* FFFFFF */
- --colors-gray-dark-alpha-12: #ffffffeb; /* FFFFFF */
- --colors-gray-light-1: #fcfcfc; /* FCFCFC */
- --colors-gray-light-2: #f8f8f8; /* F8F8F8 */
- --colors-gray-light-3: #f3f3f3; /* F3F3F3 */
- --colors-gray-light-4: #ededed; /* EDEDED */
- --colors-gray-light-5: #e8e8e8; /* E8E8E8 */
- --colors-gray-light-6: #e2e2e2; /* E2E2E2 */
- --colors-gray-light-7: #dbdbdb; /* DBDBDB */
- --colors-gray-light-8: #c7c7c7; /* C7C7C7 */
- --colors-gray-light-9: #8f8f8f; /* 8F8F8F */
- --colors-gray-light-10: #858585; /* 858585 */
- --colors-gray-light-11: #6f6f6f; /* 6F6F6F */
- --colors-gray-light-12: #171717; /* 171717 */
- --colors-gray-light-alpha-1: #00000003; /* 000000 */
- --colors-gray-light-alpha-2: #00000008; /* 000000 */
- --colors-gray-light-alpha-3: #0000000d; /* 000000 */
- --colors-gray-light-alpha-4: #00000012; /* 000000 */
- --colors-gray-light-alpha-5: #00000017; /* 000000 */
- --colors-gray-light-alpha-6: #0000001c; /* 000000 */
- --colors-gray-light-alpha-7: #00000024; /* 000000 */
- --colors-gray-light-alpha-8: #00000038; /* 000000 */
- --colors-gray-light-alpha-9: #00000070; /* 000000 */
- --colors-gray-light-alpha-10: #0000007a; /* 000000 */
- --colors-gray-light-alpha-11: #0000008f; /* 000000 */
- --colors-gray-light-alpha-12: #000000e8; /* 000000 */
- --colors-slate-dark-1: #151718; /* 151718 */
- --colors-slate-dark-2: #1a1d1e; /* 1A1D1E */
- --colors-slate-dark-3: #202425; /* 202425 */
- --colors-slate-dark-4: #26292b; /* 26292B */
- --colors-slate-dark-5: #2b2f31; /* 2B2F31 */
- --colors-slate-dark-6: #313538; /* 313538 */
- --colors-slate-dark-7: #3a3f42; /* 3A3F42 */
- --colors-slate-dark-8: #4c5155; /* 4C5155 */
- --colors-slate-dark-9: #697177; /* 697177 */
- --colors-slate-dark-10: #787f85; /* 787F85 */
- --colors-slate-dark-11: #9ba1a6; /* 9BA1A6 */
- --colors-slate-dark-12: #ecedee; /* ECEDEE */
- --colors-slate-dark-alpha-1: #00000000; /* 000000 */
- --colors-slate-dark-alpha-2: #d5feff08; /* D5FEFF */
- --colors-slate-dark-alpha-3: #d6fbfc0f; /* D6FBFC */
- --colors-slate-dark-alpha-4: #e2f0fd14; /* E2F0FD */
- --colors-slate-dark-alpha-5: #dff3fd1c; /* DFF3FD */
- --colors-slate-dark-alpha-6: #dfeffe24; /* DFEFFE */
- --colors-slate-dark-alpha-7: #e0f3ff2e; /* E0F3FF */
- --colors-slate-dark-alpha-8: #e5f2fe42; /* E5F2FE */
- --colors-slate-dark-alpha-9: #e1f1ff69; /* E1F1FF */
- --colors-slate-dark-alpha-10: #e7f3ff78; /* E7F3FF */
- --colors-slate-dark-alpha-11: #eff7ff9e; /* EFF7FF */
- --colors-slate-dark-alpha-12: #fdfeffed; /* FDFEFF */
- --colors-slate-light-1: #fbfcfd; /* FBFCFD */
- --colors-slate-light-2: #f8f9fa; /* F8F9FA */
- --colors-slate-light-3: #f1f3f5; /* F1F3F5 */
- --colors-slate-light-4: #eceef0; /* ECEEF0 */
- --colors-slate-light-5: #e6e8eb; /* E6E8EB */
- --colors-slate-light-6: #dfe3e6; /* DFE3E6 */
- --colors-slate-light-7: #d7dbdf; /* D7DBDF */
- --colors-slate-light-8: #c1c8cd; /* C1C8CD */
- --colors-slate-light-9: #889096; /* 889096 */
- --colors-slate-light-10: #7e868c; /* 7E868C */
- --colors-slate-light-11: #687076; /* 687076 */
- --colors-slate-light-12: #11181c; /* 11181C */
- --colors-slate-light-alpha-1: #05448205; /* 054482 */
- --colors-slate-light-alpha-2: #05294d08; /* 05294D */
- --colors-slate-light-alpha-3: #0025490d; /* 002549 */
- --colors-slate-light-alpha-4: #021c3714; /* 021C37 */
- --colors-slate-light-alpha-5: #0217351a; /* 021735 */
- --colors-slate-light-alpha-6: #01213921; /* 012139 */
- --colors-slate-light-alpha-7: #001a3329; /* 001A33 */
- --colors-slate-light-alpha-8: #011e323d; /* 011E32 */
- --colors-slate-light-alpha-9: #00111e78; /* 00111E */
- --colors-slate-light-alpha-10: #00101b82; /* 00101B */
- --colors-slate-light-alpha-11: #000e1896; /* 000E18 */
- --colors-slate-light-alpha-12: #00080ced; /* 00080C */
-}
diff --git a/packages/ui/build/css/source/global.css b/packages/ui/build/css/source/global.css
index 25c85f89ce9..5c2e867b21f 100644
--- a/packages/ui/build/css/source/global.css
+++ b/packages/ui/build/css/source/global.css
@@ -1,205 +1,136 @@
-/**
- * Do not edit directly
- * Generated on Thu, 10 Aug 2023 03:54:37 GMT
- */
-
:root {
- --content-width-screen-xl: 1128px;
- --base: 16;
- --input-sm-height: 28px;
- --datatable-rowheight: 28px; /* Height of datatable rows */
- --modal-drop-shadow: 1px 4px 4px 4px rgba(0,0,0,0.15);
- --icon-width-default: 1px;
- --icon-md: 18px;
- --icon-sm: 16px;
- --icon-xs: 12px;
- --variables-colors-brand-accent: 152.9deg 56.1% 46.5%;
- --variables-colors-brand-primary: 153.1deg 60.2% 52.7%;
- --text-decoration-none: none;
- --text-case-uppercase: uppercase;
- --text-case-none: none;
- --font-size-2: 48.829px;
- --font-size-1: 39.063px;
- --font-size-0: 14px;
- --inner-shadow-text-new: inset 0 0.5px 0.5px 0 #00000026;
- --inner-shadow-label-copy: inset 0 1px 1px 0 #858585;
- --font-weights-heading-mono: 500;
- --font-weights-inter-2: Book;
- --font-weights-inter-1: 500;
- --font-weights-roboto-0: 400;
- --font-weights-body-bold: 700;
- --font-weights-body-regular: 400;
- --font-weights-heading-bold: 700;
- --font-weights-heading-regular: 400;
- --paragraph-spacing-h2: 26;
- --paragraph-spacing-h1: 32;
- --paragraph-spacing-1: 32;
- --paragraph-spacing-0: 26;
- --letter-spacing-8: 0.08em;
- --letter-spacing-decreased: -0.05em;
- --letter-spacing-increased: 0.1em;
- --letter-spacing-default: 0;
- --letter-spacing-1: -0.02em;
- --letter-spacing-0: 0em;
- --line-heights-heading: 1.1;
- --line-heights-0: 1.1;
- --font-families-mono: Office Code Pro;
- --font-families-body2: Circular Std;
- --font-families-roboto: Roboto;
- --font-families-body: Circular Std;
- --font-families-heading: Inter;
- --opacity-high: 0.9;
- --opacity-md: 0.5;
- --opacity-low: 0.1;
- --colors-slate-light-alpha-1200: hsla(200, 100%, 2.4%, 0.9294117647058824); /* 00080C */
- --colors-slate-light-alpha-1100: hsla(205, 100%, 4.7%, 0.5882352941176471); /* 000E18 */
- --colors-slate-light-alpha-1000: hsla(204.39999999999998, 100%, 5.3%, 0.5098039215686274); /* 00101B */
- --colors-slate-light-alpha-900: hsla(206, 100%, 5.9%, 0.47058823529411764); /* 00111E */
- --colors-slate-light-alpha-800: hsla(204.5, 96.1%, 10%, 0.23921568627450981); /* 011E32 */
- --colors-slate-light-alpha-700: hsla(209.39999999999998, 100%, 10%, 0.1607843137254902); /* 001A33 */
- --colors-slate-light-alpha-600: hsla(205.70000000000005, 96.6%, 11.4%, 0.12941176470588237); /* 012139 */
- --colors-slate-light-alpha-500: hsla(215.29999999999995, 92.7%, 10.8%, 0.10196078431372549); /* 021735 */
- --colors-slate-light-alpha-400: hsla(210.60000000000002, 93%, 11.2%, 0.0784313725490196); /* 021C37 */
- --colors-slate-light-alpha-300: hsla(209.60000000000002, 100%, 14.3%, 0.050980392156862744); /* 002549 */
- --colors-slate-light-alpha-200: hsla(210, 87.8%, 16.1%, 0.03137254901960784); /* 05294D */
- --colors-slate-light-alpha-100: hsla(209.79999999999995, 92.6%, 26.5%, 0.0196078431372549); /* 054482 */
- --colors-slate-light-1200: 201.8deg 24.4% 8.8%; /* 11181C */
- --colors-slate-light-1100: 205.7deg 6.3% 43.5%; /* 687076 */
- --colors-slate-light-1000: 205.7deg 5.7% 52.2%; /* 7E868C */
- --colors-slate-light-900: 205.7deg 6.3% 56.1%; /* 889096 */
- --colors-slate-light-800: 205deg 10.7% 78%; /* C1C8CD */
- --colors-slate-light-700: 210deg 11.1% 85.9%; /* D7DBDF */
- --colors-slate-light-600: 205.7deg 12.3% 88.8%; /* DFE3E6 */
- --colors-slate-light-500: 216deg 11.1% 91.2%; /* E6E8EB */
- --colors-slate-light-400: 210deg 11.8% 93.3%; /* ECEEF0 */
- --colors-slate-light-300: 210deg 16.7% 95.3%; /* F1F3F5 */
- --colors-slate-light-200: 210deg 16.7% 97.6%; /* F8F9FA */
- --colors-slate-light-100: 210deg 33.3% 98.8%; /* FBFCFD */
- --colors-slate-dark-alpha-1200: hsla(210, 100%, 99.6%, 0.9294117647058824); /* FDFEFF */
- --colors-slate-dark-alpha-1100: hsla(210, 100%, 96.9%, 0.6196078431372549); /* EFF7FF */
- --colors-slate-dark-alpha-1000: hsla(210, 100%, 95.3%, 0.47058823529411764); /* E7F3FF */
- --colors-slate-dark-alpha-900: hsla(208, 100%, 94.1%, 0.4117647058823529); /* E1F1FF */
- --colors-slate-dark-alpha-800: hsla(208.79999999999995, 92.6%, 94.7%, 0.25882352941176473); /* E5F2FE */
- --colors-slate-dark-alpha-700: hsla(203.20000000000005, 100%, 93.9%, 0.1803921568627451); /* E0F3FF */
- --colors-slate-dark-alpha-600: hsla(209, 93.9%, 93.5%, 0.1411764705882353); /* DFEFFE */
- --colors-slate-dark-alpha-500: hsla(200, 88.2%, 93.3%, 0.10980392156862745); /* DFF3FD */
- --colors-slate-dark-alpha-400: hsla(208.89999999999998, 87.1%, 93.9%, 0.0784313725490196); /* E2F0FD */
- --colors-slate-dark-alpha-300: hsla(181.60000000000002, 86.4%, 91.4%, 0.058823529411764705); /* D6FBFC */
- --colors-slate-dark-alpha-200: hsla(181.39999999999998, 100%, 91.8%, 0.03137254901960784); /* D5FEFF */
- --colors-slate-dark-alpha-100: hsla(0, 0%, 0%, 0); /* 000000 */
- --colors-slate-dark-1200: 210deg 5.6% 92.9%; /* ECEDEE */
- --colors-slate-dark-1100: 207.3deg 5.8% 62.9%; /* 9BA1A6 */
- --colors-slate-dark-1000: 207.7deg 5.1% 49.6%; /* 787F85 */
- --colors-slate-dark-900: 205.7deg 6.3% 43.9%; /* 697177 */
- --colors-slate-dark-800: 206.7deg 5.6% 31.6%; /* 4C5155 */
- --colors-slate-dark-700: 202.5deg 6.5% 24.3%; /* 3A3F42 */
- --colors-slate-dark-600: 205.7deg 6.7% 20.6%; /* 313538 */
- --colors-slate-dark-500: 200deg 6.5% 18%; /* 2B2F31 */
- --colors-slate-dark-400: 204deg 6.2% 15.9%; /* 26292B */
- --colors-slate-dark-300: 192deg 7.2% 13.5%; /* 202425 */
- --colors-slate-dark-200: 195deg 7.1% 11%; /* 1A1D1E */
- --colors-slate-dark-100: 200deg 6.7% 8.8%; /* 151718 */
- --colors-gray-light-alpha-1200: hsla(0, 0%, 0%, 0.9098039215686274); /* 000000 */
- --colors-gray-light-alpha-1100: hsla(0, 0%, 0%, 0.5607843137254902); /* 000000 */
- --colors-gray-light-alpha-1000: hsla(0, 0%, 0%, 0.47843137254901963); /* 000000 */
- --colors-gray-light-alpha-900: hsla(0, 0%, 0%, 0.4392156862745098); /* 000000 */
- --colors-gray-light-alpha-800: hsla(0, 0%, 0%, 0.2196078431372549); /* 000000 */
- --colors-gray-light-alpha-700: hsla(0, 0%, 0%, 0.1411764705882353); /* 000000 */
- --colors-gray-light-alpha-600: hsla(0, 0%, 0%, 0.10980392156862745); /* 000000 */
- --colors-gray-light-alpha-500: hsla(0, 0%, 0%, 0.09019607843137255); /* 000000 */
- --colors-gray-light-alpha-400: hsla(0, 0%, 0%, 0.07058823529411765); /* 000000 */
- --colors-gray-light-alpha-300: hsla(0, 0%, 0%, 0.050980392156862744); /* 000000 */
- --colors-gray-light-alpha-200: hsla(0, 0%, 0%, 0.03137254901960784); /* 000000 */
- --colors-gray-light-alpha-100: hsla(0, 0%, 0%, 0.011764705882352941); /* 000000 */
- --colors-gray-light-1200: 0deg 0% 9%; /* 171717 */
- --colors-gray-light-1100: 0deg 0% 43.5%; /* 6F6F6F */
- --colors-gray-light-1000: 0deg 0% 52.2%; /* 858585 */
- --colors-gray-light-900: 0deg 0% 56.1%; /* 8F8F8F */
- --colors-gray-light-800: 0deg 0% 78%; /* C7C7C7 */
- --colors-gray-light-700: 0deg 0% 85.9%; /* DBDBDB */
- --colors-gray-light-600: 0deg 0% 88.6%; /* E2E2E2 */
- --colors-gray-light-500: 0deg 0% 91%; /* E8E8E8 */
- --colors-gray-light-400: 0deg 0% 92.9%; /* EDEDED */
- --colors-gray-light-300: 0deg 0% 95.3%; /* F3F3F3 */
- --colors-gray-light-200: 0deg 0% 97.3%; /* F8F8F8 */
- --colors-gray-light-100: 0deg 0% 98.8%; /* FCFCFC */
- --colors-gray-dark-alpha-1200: hsla(0, 0%, 100%, 0.9215686274509803); /* FFFFFF */
- --colors-gray-dark-alpha-1100: hsla(0, 0%, 100%, 0.5882352941176471); /* FFFFFF */
- --colors-gray-dark-alpha-1000: hsla(0, 0%, 100%, 0.45098039215686275); /* FFFFFF */
- --colors-gray-dark-alpha-900: hsla(0, 0%, 100%, 0.38823529411764707); /* FFFFFF */
- --colors-gray-dark-alpha-800: hsla(0, 0%, 100%, 0.25098039215686274); /* FFFFFF */
- --colors-gray-dark-alpha-700: hsla(0, 0%, 100%, 0.16862745098039217); /* FFFFFF */
- --colors-gray-dark-alpha-600: hsla(0, 0%, 100%, 0.12941176470588237); /* FFFFFF */
- --colors-gray-dark-alpha-500: hsla(0, 0%, 100%, 0.10196078431372549); /* FFFFFF */
- --colors-gray-dark-alpha-400: hsla(0, 0%, 100%, 0.0784313725490196); /* FFFFFF */
- --colors-gray-dark-alpha-300: hsla(0, 0%, 100%, 0.058823529411764705); /* FFFFFF */
- --colors-gray-dark-alpha-200: hsla(0, 0%, 100%, 0.03137254901960784); /* FFFFFF */
- --colors-gray-dark-alpha-100: hsla(0, 0%, 0%, 0); /* 000000 */
- --colors-gray-dark-1200: 0deg 0% 92.9%; /* EDEDED */
- --colors-gray-dark-1100: 0deg 0% 62.7%; /* A0A0A0 */
- --colors-gray-dark-1000: 0deg 0% 49.4%; /* 7E7E7E */
- --colors-gray-dark-900: 0deg 0% 43.9%; /* 707070 */
- --colors-gray-dark-800: 0deg 0% 31.4%; /* 505050 */
- --colors-gray-dark-700: 0deg 0% 24.3%; /* 3E3E3E */
- --colors-gray-dark-600: 0deg 0% 20.4%; /* 343434 */
- --colors-gray-dark-500: 0deg 0% 18%; /* 2E2E2E */
- --colors-gray-dark-400: 0deg 0% 15.7%; /* 282828 */
- --colors-gray-dark-300: 0deg 0% 13.7%; /* 232323 */
- --colors-gray-dark-200: 0deg 0% 11%; /* 1C1C1C */
- --colors-gray-dark-100: 0deg 0% 8.6%; /* 161616 */
- --colors-white: 0deg 0% 100%;
--colors-black: 0deg 0% 0%;
- --border-width-lg: 8px;
- --border-width-md: 4px;
- --border-width-sm: 2px;
- --border-width-xs: 1px;
- --border-width-none: 0;
- --border-radius-xs: 2px;
- --border-radius-xl: 16px;
- --border-radius-lg: 8px;
- --border-radius-sm: 4px;
- --sizing-xs: 4px;
- --sizing-scale: 1.5px;
- --spacing-xs: 4px;
+ --colors-white: 0deg 0% 100%;
+ --colors-gray-dark-100: 0deg 0% 8.6%;
+ --colors-gray-dark-200: 0deg 0% 11%;
+ --colors-gray-dark-300: 0deg 0% 13.7%;
+ --colors-gray-dark-400: 0deg 0% 15.7%;
+ --colors-gray-dark-500: 0deg 0% 18%;
+ --colors-gray-dark-600: 0deg 0% 20.4%;
+ --colors-gray-dark-700: 0deg 0% 24.3%;
+ --colors-gray-dark-800: 0deg 0% 31.4%;
+ --colors-gray-dark-900: 0deg 0% 43.9%;
+ --colors-gray-dark-1000: 0deg 0% 49.4%;
+ --colors-gray-dark-1100: 0deg 0% 62.7%;
+ --colors-gray-dark-1200: 0deg 0% 92.9%;
+ --colors-gray-dark-alpha-100: hsla(0, 0%, 0%, 0);
+ --colors-gray-dark-alpha-200: hsla(0, 0%, 100%, 0.03137254901960784);
+ --colors-gray-dark-alpha-300: hsla(0, 0%, 100%, 0.058823529411764705);
+ --colors-gray-dark-alpha-400: hsla(0, 0%, 100%, 0.0784313725490196);
+ --colors-gray-dark-alpha-500: hsla(0, 0%, 100%, 0.10196078431372549);
+ --colors-gray-dark-alpha-600: hsla(0, 0%, 100%, 0.12941176470588237);
+ --colors-gray-dark-alpha-700: hsla(0, 0%, 100%, 0.16862745098039217);
+ --colors-gray-dark-alpha-800: hsla(0, 0%, 100%, 0.25098039215686274);
+ --colors-gray-dark-alpha-900: hsla(0, 0%, 100%, 0.38823529411764707);
+ --colors-gray-dark-alpha-1000: hsla(0, 0%, 100%, 0.45098039215686275);
+ --colors-gray-dark-alpha-1100: hsla(0, 0%, 100%, 0.5882352941176471);
+ --colors-gray-dark-alpha-1200: hsla(0, 0%, 100%, 0.9215686274509803);
+ --colors-gray-light-100: 0deg 0% 98.8%;
+ --colors-gray-light-200: 0deg 0% 97.3%;
+ --colors-gray-light-300: 0deg 0% 95.3%;
+ --colors-gray-light-400: 0deg 0% 92.9%;
+ --colors-gray-light-500: 0deg 0% 91%;
+ --colors-gray-light-600: 0deg 0% 88.6%;
+ --colors-gray-light-700: 0deg 0% 85.9%;
+ --colors-gray-light-800: 0deg 0% 78%;
+ --colors-gray-light-900: 0deg 0% 56.1%;
+ --colors-gray-light-1000: 0deg 0% 52.2%;
+ --colors-gray-light-1100: 0deg 0% 43.5%;
+ --colors-gray-light-1200: 0deg 0% 9%;
+ --colors-gray-light-alpha-100: hsla(0, 0%, 0%, 0.011764705882352941);
+ --colors-gray-light-alpha-200: hsla(0, 0%, 0%, 0.03137254901960784);
+ --colors-gray-light-alpha-300: hsla(0, 0%, 0%, 0.050980392156862744);
+ --colors-gray-light-alpha-400: hsla(0, 0%, 0%, 0.07058823529411765);
+ --colors-gray-light-alpha-500: hsla(0, 0%, 0%, 0.09019607843137255);
+ --colors-gray-light-alpha-600: hsla(0, 0%, 0%, 0.10980392156862745);
+ --colors-gray-light-alpha-700: hsla(0, 0%, 0%, 0.1411764705882353);
+ --colors-gray-light-alpha-800: hsla(0, 0%, 0%, 0.2196078431372549);
+ --colors-gray-light-alpha-900: hsla(0, 0%, 0%, 0.4392156862745098);
+ --colors-gray-light-alpha-1000: hsla(0, 0%, 0%, 0.47843137254901963);
+ --colors-gray-light-alpha-1100: hsla(0, 0%, 0%, 0.5607843137254902);
+ --colors-gray-light-alpha-1200: hsla(0, 0%, 0%, 0.9098039215686274);
+ --colors-slate-dark-100: 200deg 6.7% 8.8%;
+ --colors-slate-dark-200: 195deg 7.1% 11%;
+ --colors-slate-dark-300: 192deg 7.2% 13.5%;
+ --colors-slate-dark-400: 204deg 6.2% 15.9%;
+ --colors-slate-dark-500: 200deg 6.5% 18%;
+ --colors-slate-dark-600: 205.7deg 6.7% 20.6%;
+ --colors-slate-dark-700: 202.5deg 6.5% 24.3%;
+ --colors-slate-dark-800: 206.7deg 5.6% 31.6%;
+ --colors-slate-dark-900: 205.7deg 6.3% 43.9%;
+ --colors-slate-dark-1000: 207.7deg 5.1% 49.6%;
+ --colors-slate-dark-1100: 207.3deg 5.8% 62.9%;
+ --colors-slate-dark-1200: 210deg 5.6% 92.9%;
+ --colors-slate-dark-alpha-100: hsla(0, 0%, 0%, 0);
+ --colors-slate-dark-alpha-200: hsla(181.39999999999998, 100%, 91.8%, 0.03137254901960784);
+ --colors-slate-dark-alpha-300: hsla(181.60000000000002, 86.4%, 91.4%, 0.058823529411764705);
+ --colors-slate-dark-alpha-400: hsla(208.89999999999998, 87.1%, 93.9%, 0.0784313725490196);
+ --colors-slate-dark-alpha-500: hsla(200, 88.2%, 93.3%, 0.10980392156862745);
+ --colors-slate-dark-alpha-600: hsla(209, 93.9%, 93.5%, 0.1411764705882353);
+ --colors-slate-dark-alpha-700: hsla(203.20000000000005, 100%, 93.9%, 0.1803921568627451);
+ --colors-slate-dark-alpha-800: hsla(208.79999999999995, 92.6%, 94.7%, 0.25882352941176473);
+ --colors-slate-dark-alpha-900: hsla(208, 100%, 94.1%, 0.4117647058823529);
+ --colors-slate-dark-alpha-1000: hsla(210, 100%, 95.3%, 0.47058823529411764);
+ --colors-slate-dark-alpha-1100: hsla(210, 100%, 96.9%, 0.6196078431372549);
+ --colors-slate-dark-alpha-1200: hsla(210, 100%, 99.6%, 0.9294117647058824);
+ --colors-slate-light-100: 210deg 33.3% 98.8%;
+ --colors-slate-light-200: 210deg 16.7% 97.6%;
+ --colors-slate-light-300: 210deg 16.7% 95.3%;
+ --colors-slate-light-400: 210deg 11.8% 93.3%;
+ --colors-slate-light-500: 216deg 11.1% 91.2%;
+ --colors-slate-light-600: 205.7deg 12.3% 88.8%;
+ --colors-slate-light-700: 210deg 11.1% 85.9%;
+ --colors-slate-light-800: 205deg 10.7% 78%;
+ --colors-slate-light-900: 205.7deg 6.3% 56.1%;
+ --colors-slate-light-1000: 205.7deg 5.7% 52.2%;
+ --colors-slate-light-1100: 205.7deg 6.3% 43.5%;
+ --colors-slate-light-1200: 201.8deg 24.4% 8.8%;
+ --colors-slate-light-alpha-100: hsla(209.79999999999995, 92.6%, 26.5%, 0.0196078431372549);
+ --colors-slate-light-alpha-200: hsla(210, 87.8%, 16.1%, 0.03137254901960784);
+ --colors-slate-light-alpha-300: hsla(209.60000000000002, 100%, 14.3%, 0.050980392156862744);
+ --colors-slate-light-alpha-400: hsla(210.60000000000002, 93%, 11.2%, 0.0784313725490196);
+ --colors-slate-light-alpha-500: hsla(215.29999999999995, 92.7%, 10.8%, 0.10196078431372549);
+ --colors-slate-light-alpha-600: hsla(205.70000000000005, 96.6%, 11.4%, 0.12941176470588237);
+ --colors-slate-light-alpha-700: hsla(209.39999999999998, 100%, 10%, 0.1607843137254902);
+ --colors-slate-light-alpha-800: hsla(204.5, 96.1%, 10%, 0.23921568627450981);
+ --colors-slate-light-alpha-900: hsla(206, 100%, 5.9%, 0.47058823529411764);
+ --colors-slate-light-alpha-1000: hsla(204.39999999999998, 100%, 5.3%, 0.5098039215686274);
+ --colors-slate-light-alpha-1100: hsla(205, 100%, 4.7%, 0.5882352941176471);
+ --colors-slate-light-alpha-1200: hsla(200, 100%, 2.4%, 0.9294117647058824);
+ --variables-colors-brand-primary: 153.1deg 60.2% 52.7%;
+ --variables-colors-brand-accent: 152.9deg 56.1% 46.5%;
--spacing-scale: 2px;
- --panel2: var(--border-radius-sm);
- --options-icon: var(--icon-md); /* Size of product/dropdown icons icons */
- --datatable-headericon: var(--icon-sm);
- --panel: var(--border-radius-xs);
- --font-sizes-9xl: 128;
- --font-sizes-8xl: 96;
- --font-sizes-7xl: 72;
- --font-sizes-6xl: 60;
- --font-sizes-xs: 12;
- --font-sizes-sm: 14;
- --font-sizes-base: var(--base);
- --font-sizes-lg: 18;
- --font-sizes-xl: 20;
- --font-sizes-2xl: 24;
- --font-sizes-3xl: 30;
- --font-sizes-4xl: 36;
- --font-sizes-5xl: 48;
- --line-heights-9xl: 128;
- --line-heights-8xl: 96;
- --line-heights-7xl: 72;
- --line-heights-6xl: 60;
- --line-heights-5xl: 48;
- --line-heights-4xl: 40;
- --line-heights-3xl: var(--base) *2.25;
- --line-heights-2xl: 32;
- --line-heights-xl: 28;
- --line-heights-lg: 28;
- --line-heights-sm: 20;
- --line-heights-xs: var(--base);
- --line-heights-base: 24;
- --border-radius-table-header: var(--border-radius-sm);
- --sizing-sm: 6px;
+ --spacing-xs: 4px;
--spacing-sm: 8px;
- --sizing-md: 9px;
--spacing-md: 16px;
+ --spacing-lg: 32px;
+ --spacing-xl: 64px;
+ --sizing-scale: 1.5px;
+ --sizing-xs: 4px;
+ --sizing-sm: 6px;
+ --sizing-md: 9px;
--sizing-lg: 13.5px;
- --spacing-lg: 3var(--spacing-scale);
--sizing-xl: 20.25px;
- --spacing-xl: 64px;
+ --borderradius-sm: 4px;
+ --borderradius-lg: 8px;
+ --borderradius-xl: 16px;
+ --borderradius-xs: 2px;
+ --borderradius-tableheader: 4px;
+ --borderwidth-none: 0;
+ --borderwidth-xs: 1px;
+ --borderwidth-sm: 2px;
+ --borderwidth-md: 4px;
+ --borderwidth-lg: 8px;
+ --icon-xs: 12px;
+ --icon-sm: 16px;
+ --icon-md: 18px;
+ --iconwidth-default: 1px;
+ --panel: 2px;
+ --datatable-headericon: 16px;
+ --datatable-rowheight: 28px;
+ --options-icon: 18px;
+ --input-sm-height: 28px;
+ --panel2: 4px;
--xxl: 128px;
+ --content-width-screen-xl: 1128px;
}
diff --git a/packages/ui/build/css/themes/dark.css b/packages/ui/build/css/themes/dark.css
index b3e3e0810e4..5ef407d572a 100644
--- a/packages/ui/build/css/themes/dark.css
+++ b/packages/ui/build/css/themes/dark.css
@@ -1,10 +1,7 @@
-/**
- * Do not edit directly
- * Generated on Thu, 10 Aug 2023 03:54:37 GMT
- */
-
.dark {
- --brand-default: 152.9deg 60% 52.9%;
+ --secondary: 0deg 0% 100%;
+ --brand-accent: 152.9deg 60% 52.9%;
+ --brand-default: 153.1deg 60.2% 52.7%;
--brand-600: 153deg 59.5% 70%;
--brand-500: 153.5deg 61.8% 21.6%;
--brand-400: 153.3deg 65.2% 13.5%;
@@ -22,15 +19,21 @@
--destructive-400: 6.7deg 60% 20.6%;
--destructive-300: 7.5deg 51.3% 15.3%;
--destructive-200: 10.9deg 23.4% 9.2%;
+ --background-secondary: 0deg 0% 100%;
+ --foreground-contrast: 0deg 0% 11%;
--foreground-strong: 0deg 0% 100%;
+ --border-stronger: var(--colors-gray-dark-800);
+ --border-strong: var(--colors-gray-dark-700);
--border-alternative: var(--colors-gray-dark-500);
--border-control: var(--colors-gray-dark-600);
--border-overlay: var(--colors-gray-dark-400);
--border-secondary: var(--colors-gray-dark-400);
--border-muted: var(--colors-gray-dark-400);
--border-default: var(--colors-gray-dark-500);
+ --background-muted: var(--colors-gray-dark-400);
--background-overlay-hover: var(--colors-gray-dark-500);
--background-overlay-default: var(--colors-gray-dark-300);
+ --background-surface-contrast-300: var(--colors-gray-dark-500);
--background-surface-300: var(--colors-gray-dark-500);
--background-surface-200: var(--colors-gray-dark-400);
--background-surface-100: var(--colors-gray-dark-300);
diff --git a/packages/ui/build/css/themes/light.css b/packages/ui/build/css/themes/light.css
index 53ad19057be..c4684735942 100644
--- a/packages/ui/build/css/themes/light.css
+++ b/packages/ui/build/css/themes/light.css
@@ -1,9 +1,6 @@
-/**
- * Do not edit directly
- * Generated on Thu, 10 Aug 2023 03:54:37 GMT
- */
-
.light {
+ --secondary: 0deg 0% 100%;
+ --brand-accent: 152.9deg 60% 52.9%;
--brand-default: 152.9deg 60% 52.9%;
--brand-600: 153.2deg 49.7% 33.5%;
--brand-500: 148.7deg 42.7% 69.2%;
@@ -22,17 +19,21 @@
--destructive-400: 7.1deg 91.3% 91%;
--destructive-300: 7.1deg 100% 96.7%;
--destructive-200: 0deg 100% 99.4%;
- --background-alternative: 0deg 0% 100%;
--background-muted: 0deg 0% 100%;
--background-secondary: 0deg 0% 100%;
- --border-control: var(--colors-slate-light-600);
+ --background-alternative: 0deg 0% 100%;
+ --foreground-contrast: 210deg 25% 98.4%;
+ --border-stronger: var(--colors-gray-light-800);
+ --border-strong: var(--colors-gray-light-700);
--border-alternative: var(--colors-slate-light-500);
+ --border-control: var(--colors-slate-light-600);
--border-overlay: var(--colors-slate-light-500);
--border-secondary: var(--colors-gray-dark-400);
--border-muted: var(--colors-gray-dark-400);
--border-default: var(--colors-slate-light-500);
--background-overlay-hover: var(--colors-slate-light-300);
--background-overlay-default: var(--colors-slate-light-100);
+ --background-surface-contrast-300: var(--colors-slate-light-400);
--background-surface-300: var(--colors-slate-light-400);
--background-surface-200: var(--colors-slate-light-300);
--background-surface-100: var(--colors-slate-light-100);
diff --git a/packages/ui/build/css/tw-extend/color.js b/packages/ui/build/css/tw-extend/color.js
index 937addc4752..253ef5e81ad 100644
--- a/packages/ui/build/css/tw-extend/color.js
+++ b/packages/ui/build/css/tw-extend/color.js
@@ -1,402 +1,402 @@
module.exports = {
"colors-black": {
- cssVariable: "var(--colors-black)",
+ cssVariable: "var(--core-colors-black)",
value: "hsl(0, 0%, 0%)"
},
"colors-white": {
- cssVariable: "var(--colors-white)",
+ cssVariable: "var(--core-colors-white)",
value: "hsl(0, 0%, 100%)"
},
-"colors-Gray-Dark-100": {
- cssVariable: "var(--colors-gray-dark-100)",
+"colors-gray-dark-100": {
+ cssVariable: "var(--core-colors-gray-dark-100)",
value: "hsl(0, 0%, 8.6%)"
},
-"colors-Gray-Dark-200": {
- cssVariable: "var(--colors-gray-dark-200)",
+"colors-gray-dark-200": {
+ cssVariable: "var(--core-colors-gray-dark-200)",
value: "hsl(0, 0%, 11%)"
},
-"colors-Gray-Dark-300": {
- cssVariable: "var(--colors-gray-dark-300)",
+"colors-gray-dark-300": {
+ cssVariable: "var(--core-colors-gray-dark-300)",
value: "hsl(0, 0%, 13.7%)"
},
-"colors-Gray-Dark-400": {
- cssVariable: "var(--colors-gray-dark-400)",
+"colors-gray-dark-400": {
+ cssVariable: "var(--core-colors-gray-dark-400)",
value: "hsl(0, 0%, 15.7%)"
},
-"colors-Gray-Dark-500": {
- cssVariable: "var(--colors-gray-dark-500)",
+"colors-gray-dark-500": {
+ cssVariable: "var(--core-colors-gray-dark-500)",
value: "hsl(0, 0%, 18%)"
},
-"colors-Gray-Dark-600": {
- cssVariable: "var(--colors-gray-dark-600)",
+"colors-gray-dark-600": {
+ cssVariable: "var(--core-colors-gray-dark-600)",
value: "hsl(0, 0%, 20.4%)"
},
-"colors-Gray-Dark-700": {
- cssVariable: "var(--colors-gray-dark-700)",
+"colors-gray-dark-700": {
+ cssVariable: "var(--core-colors-gray-dark-700)",
value: "hsl(0, 0%, 24.3%)"
},
-"colors-Gray-Dark-800": {
- cssVariable: "var(--colors-gray-dark-800)",
+"colors-gray-dark-800": {
+ cssVariable: "var(--core-colors-gray-dark-800)",
value: "hsl(0, 0%, 31.4%)"
},
-"colors-Gray-Dark-900": {
- cssVariable: "var(--colors-gray-dark-900)",
+"colors-gray-dark-900": {
+ cssVariable: "var(--core-colors-gray-dark-900)",
value: "hsl(0, 0%, 43.9%)"
},
-"colors-Gray-Dark-1000": {
- cssVariable: "var(--colors-gray-dark-1000)",
+"colors-gray-dark-1000": {
+ cssVariable: "var(--core-colors-gray-dark-1000)",
value: "hsl(0, 0%, 49.4%)"
},
-"colors-Gray-Dark-1100": {
- cssVariable: "var(--colors-gray-dark-1100)",
+"colors-gray-dark-1100": {
+ cssVariable: "var(--core-colors-gray-dark-1100)",
value: "hsl(0, 0%, 62.7%)"
},
-"colors-Gray-Dark-1200": {
- cssVariable: "var(--colors-gray-dark-1200)",
+"colors-gray-dark-1200": {
+ cssVariable: "var(--core-colors-gray-dark-1200)",
value: "hsl(0, 0%, 92.9%)"
},
-"colors-Gray-Dark-Alpha-100": {
- cssVariable: "var(--colors-gray-dark-alpha-100)",
+"colors-gray-dark-alpha-100": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-100)",
value: "hsla(0, 0%, 0%, 0)"
},
-"colors-Gray-Dark-Alpha-200": {
- cssVariable: "var(--colors-gray-dark-alpha-200)",
+"colors-gray-dark-alpha-200": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-200)",
value: "hsla(0, 0%, 100%, 0.03137254901960784)"
},
-"colors-Gray-Dark-Alpha-300": {
- cssVariable: "var(--colors-gray-dark-alpha-300)",
+"colors-gray-dark-alpha-300": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-300)",
value: "hsla(0, 0%, 100%, 0.058823529411764705)"
},
-"colors-Gray-Dark-Alpha-400": {
- cssVariable: "var(--colors-gray-dark-alpha-400)",
+"colors-gray-dark-alpha-400": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-400)",
value: "hsla(0, 0%, 100%, 0.0784313725490196)"
},
-"colors-Gray-Dark-Alpha-500": {
- cssVariable: "var(--colors-gray-dark-alpha-500)",
+"colors-gray-dark-alpha-500": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-500)",
value: "hsla(0, 0%, 100%, 0.10196078431372549)"
},
-"colors-Gray-Dark-Alpha-600": {
- cssVariable: "var(--colors-gray-dark-alpha-600)",
+"colors-gray-dark-alpha-600": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-600)",
value: "hsla(0, 0%, 100%, 0.12941176470588237)"
},
-"colors-Gray-Dark-Alpha-700": {
- cssVariable: "var(--colors-gray-dark-alpha-700)",
+"colors-gray-dark-alpha-700": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-700)",
value: "hsla(0, 0%, 100%, 0.16862745098039217)"
},
-"colors-Gray-Dark-Alpha-800": {
- cssVariable: "var(--colors-gray-dark-alpha-800)",
+"colors-gray-dark-alpha-800": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-800)",
value: "hsla(0, 0%, 100%, 0.25098039215686274)"
},
-"colors-Gray-Dark-Alpha-900": {
- cssVariable: "var(--colors-gray-dark-alpha-900)",
+"colors-gray-dark-alpha-900": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-900)",
value: "hsla(0, 0%, 100%, 0.38823529411764707)"
},
-"colors-Gray-Dark-Alpha-1000": {
- cssVariable: "var(--colors-gray-dark-alpha-1000)",
+"colors-gray-dark-alpha-1000": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-1000)",
value: "hsla(0, 0%, 100%, 0.45098039215686275)"
},
-"colors-Gray-Dark-Alpha-1100": {
- cssVariable: "var(--colors-gray-dark-alpha-1100)",
+"colors-gray-dark-alpha-1100": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-1100)",
value: "hsla(0, 0%, 100%, 0.5882352941176471)"
},
-"colors-Gray-Dark-Alpha-1200": {
- cssVariable: "var(--colors-gray-dark-alpha-1200)",
+"colors-gray-dark-alpha-1200": {
+ cssVariable: "var(--core-colors-gray-dark-alpha-1200)",
value: "hsla(0, 0%, 100%, 0.9215686274509803)"
},
-"colors-Gray-Light-100": {
- cssVariable: "var(--colors-gray-light-100)",
+"colors-gray-light-100": {
+ cssVariable: "var(--core-colors-gray-light-100)",
value: "hsl(0, 0%, 98.8%)"
},
-"colors-Gray-Light-200": {
- cssVariable: "var(--colors-gray-light-200)",
+"colors-gray-light-200": {
+ cssVariable: "var(--core-colors-gray-light-200)",
value: "hsl(0, 0%, 97.3%)"
},
-"colors-Gray-Light-300": {
- cssVariable: "var(--colors-gray-light-300)",
+"colors-gray-light-300": {
+ cssVariable: "var(--core-colors-gray-light-300)",
value: "hsl(0, 0%, 95.3%)"
},
-"colors-Gray-Light-400": {
- cssVariable: "var(--colors-gray-light-400)",
+"colors-gray-light-400": {
+ cssVariable: "var(--core-colors-gray-light-400)",
value: "hsl(0, 0%, 92.9%)"
},
-"colors-Gray-Light-500": {
- cssVariable: "var(--colors-gray-light-500)",
+"colors-gray-light-500": {
+ cssVariable: "var(--core-colors-gray-light-500)",
value: "hsl(0, 0%, 91%)"
},
-"colors-Gray-Light-600": {
- cssVariable: "var(--colors-gray-light-600)",
+"colors-gray-light-600": {
+ cssVariable: "var(--core-colors-gray-light-600)",
value: "hsl(0, 0%, 88.6%)"
},
-"colors-Gray-Light-700": {
- cssVariable: "var(--colors-gray-light-700)",
+"colors-gray-light-700": {
+ cssVariable: "var(--core-colors-gray-light-700)",
value: "hsl(0, 0%, 85.9%)"
},
-"colors-Gray-Light-800": {
- cssVariable: "var(--colors-gray-light-800)",
+"colors-gray-light-800": {
+ cssVariable: "var(--core-colors-gray-light-800)",
value: "hsl(0, 0%, 78%)"
},
-"colors-Gray-Light-900": {
- cssVariable: "var(--colors-gray-light-900)",
+"colors-gray-light-900": {
+ cssVariable: "var(--core-colors-gray-light-900)",
value: "hsl(0, 0%, 56.1%)"
},
-"colors-Gray-Light-1000": {
- cssVariable: "var(--colors-gray-light-1000)",
+"colors-gray-light-1000": {
+ cssVariable: "var(--core-colors-gray-light-1000)",
value: "hsl(0, 0%, 52.2%)"
},
-"colors-Gray-Light-1100": {
- cssVariable: "var(--colors-gray-light-1100)",
+"colors-gray-light-1100": {
+ cssVariable: "var(--core-colors-gray-light-1100)",
value: "hsl(0, 0%, 43.5%)"
},
-"colors-Gray-Light-1200": {
- cssVariable: "var(--colors-gray-light-1200)",
+"colors-gray-light-1200": {
+ cssVariable: "var(--core-colors-gray-light-1200)",
value: "hsl(0, 0%, 9%)"
},
-"colors-Gray-Light-Alpha-100": {
- cssVariable: "var(--colors-gray-light-alpha-100)",
+"colors-gray-light-alpha-100": {
+ cssVariable: "var(--core-colors-gray-light-alpha-100)",
value: "hsla(0, 0%, 0%, 0.011764705882352941)"
},
-"colors-Gray-Light-Alpha-200": {
- cssVariable: "var(--colors-gray-light-alpha-200)",
+"colors-gray-light-alpha-200": {
+ cssVariable: "var(--core-colors-gray-light-alpha-200)",
value: "hsla(0, 0%, 0%, 0.03137254901960784)"
},
-"colors-Gray-Light-Alpha-300": {
- cssVariable: "var(--colors-gray-light-alpha-300)",
+"colors-gray-light-alpha-300": {
+ cssVariable: "var(--core-colors-gray-light-alpha-300)",
value: "hsla(0, 0%, 0%, 0.050980392156862744)"
},
-"colors-Gray-Light-Alpha-400": {
- cssVariable: "var(--colors-gray-light-alpha-400)",
+"colors-gray-light-alpha-400": {
+ cssVariable: "var(--core-colors-gray-light-alpha-400)",
value: "hsla(0, 0%, 0%, 0.07058823529411765)"
},
-"colors-Gray-Light-Alpha-500": {
- cssVariable: "var(--colors-gray-light-alpha-500)",
+"colors-gray-light-alpha-500": {
+ cssVariable: "var(--core-colors-gray-light-alpha-500)",
value: "hsla(0, 0%, 0%, 0.09019607843137255)"
},
-"colors-Gray-Light-Alpha-600": {
- cssVariable: "var(--colors-gray-light-alpha-600)",
+"colors-gray-light-alpha-600": {
+ cssVariable: "var(--core-colors-gray-light-alpha-600)",
value: "hsla(0, 0%, 0%, 0.10980392156862745)"
},
-"colors-Gray-Light-Alpha-700": {
- cssVariable: "var(--colors-gray-light-alpha-700)",
+"colors-gray-light-alpha-700": {
+ cssVariable: "var(--core-colors-gray-light-alpha-700)",
value: "hsla(0, 0%, 0%, 0.1411764705882353)"
},
-"colors-Gray-Light-Alpha-800": {
- cssVariable: "var(--colors-gray-light-alpha-800)",
+"colors-gray-light-alpha-800": {
+ cssVariable: "var(--core-colors-gray-light-alpha-800)",
value: "hsla(0, 0%, 0%, 0.2196078431372549)"
},
-"colors-Gray-Light-Alpha-900": {
- cssVariable: "var(--colors-gray-light-alpha-900)",
+"colors-gray-light-alpha-900": {
+ cssVariable: "var(--core-colors-gray-light-alpha-900)",
value: "hsla(0, 0%, 0%, 0.4392156862745098)"
},
-"colors-Gray-Light-Alpha-1000": {
- cssVariable: "var(--colors-gray-light-alpha-1000)",
+"colors-gray-light-alpha-1000": {
+ cssVariable: "var(--core-colors-gray-light-alpha-1000)",
value: "hsla(0, 0%, 0%, 0.47843137254901963)"
},
-"colors-Gray-Light-Alpha-1100": {
- cssVariable: "var(--colors-gray-light-alpha-1100)",
+"colors-gray-light-alpha-1100": {
+ cssVariable: "var(--core-colors-gray-light-alpha-1100)",
value: "hsla(0, 0%, 0%, 0.5607843137254902)"
},
-"colors-Gray-Light-Alpha-1200": {
- cssVariable: "var(--colors-gray-light-alpha-1200)",
+"colors-gray-light-alpha-1200": {
+ cssVariable: "var(--core-colors-gray-light-alpha-1200)",
value: "hsla(0, 0%, 0%, 0.9098039215686274)"
},
-"colors-Slate-Dark-100": {
- cssVariable: "var(--colors-slate-dark-100)",
+"colors-slate-dark-100": {
+ cssVariable: "var(--core-colors-slate-dark-100)",
value: "hsl(200, 6.7%, 8.8%)"
},
-"colors-Slate-Dark-200": {
- cssVariable: "var(--colors-slate-dark-200)",
+"colors-slate-dark-200": {
+ cssVariable: "var(--core-colors-slate-dark-200)",
value: "hsl(195, 7.1%, 11%)"
},
-"colors-Slate-Dark-300": {
- cssVariable: "var(--colors-slate-dark-300)",
+"colors-slate-dark-300": {
+ cssVariable: "var(--core-colors-slate-dark-300)",
value: "hsl(192, 7.2%, 13.5%)"
},
-"colors-Slate-Dark-400": {
- cssVariable: "var(--colors-slate-dark-400)",
+"colors-slate-dark-400": {
+ cssVariable: "var(--core-colors-slate-dark-400)",
value: "hsl(204, 6.2%, 15.9%)"
},
-"colors-Slate-Dark-500": {
- cssVariable: "var(--colors-slate-dark-500)",
+"colors-slate-dark-500": {
+ cssVariable: "var(--core-colors-slate-dark-500)",
value: "hsl(200, 6.5%, 18%)"
},
-"colors-Slate-Dark-600": {
- cssVariable: "var(--colors-slate-dark-600)",
+"colors-slate-dark-600": {
+ cssVariable: "var(--core-colors-slate-dark-600)",
value: "hsl(205.70000000000005, 6.7%, 20.6%)"
},
-"colors-Slate-Dark-700": {
- cssVariable: "var(--colors-slate-dark-700)",
+"colors-slate-dark-700": {
+ cssVariable: "var(--core-colors-slate-dark-700)",
value: "hsl(202.5, 6.5%, 24.3%)"
},
-"colors-Slate-Dark-800": {
- cssVariable: "var(--colors-slate-dark-800)",
+"colors-slate-dark-800": {
+ cssVariable: "var(--core-colors-slate-dark-800)",
value: "hsl(206.70000000000005, 5.6%, 31.6%)"
},
-"colors-Slate-Dark-900": {
- cssVariable: "var(--colors-slate-dark-900)",
+"colors-slate-dark-900": {
+ cssVariable: "var(--core-colors-slate-dark-900)",
value: "hsl(205.70000000000005, 6.3%, 43.9%)"
},
-"colors-Slate-Dark-1000": {
- cssVariable: "var(--colors-slate-dark-1000)",
+"colors-slate-dark-1000": {
+ cssVariable: "var(--core-colors-slate-dark-1000)",
value: "hsl(207.70000000000005, 5.1%, 49.6%)"
},
-"colors-Slate-Dark-1100": {
- cssVariable: "var(--colors-slate-dark-1100)",
+"colors-slate-dark-1100": {
+ cssVariable: "var(--core-colors-slate-dark-1100)",
value: "hsl(207.29999999999995, 5.8%, 62.9%)"
},
-"colors-Slate-Dark-1200": {
- cssVariable: "var(--colors-slate-dark-1200)",
+"colors-slate-dark-1200": {
+ cssVariable: "var(--core-colors-slate-dark-1200)",
value: "hsl(210, 5.6%, 92.9%)"
},
-"colors-Slate-Dark-Alpha-100": {
- cssVariable: "var(--colors-slate-dark-alpha-100)",
+"colors-slate-dark-alpha-100": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-100)",
value: "hsla(0, 0%, 0%, 0)"
},
-"colors-Slate-Dark-Alpha-200": {
- cssVariable: "var(--colors-slate-dark-alpha-200)",
+"colors-slate-dark-alpha-200": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-200)",
value: "hsla(181.39999999999998, 100%, 91.8%, 0.03137254901960784)"
},
-"colors-Slate-Dark-Alpha-300": {
- cssVariable: "var(--colors-slate-dark-alpha-300)",
+"colors-slate-dark-alpha-300": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-300)",
value: "hsla(181.60000000000002, 86.4%, 91.4%, 0.058823529411764705)"
},
-"colors-Slate-Dark-Alpha-400": {
- cssVariable: "var(--colors-slate-dark-alpha-400)",
+"colors-slate-dark-alpha-400": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-400)",
value: "hsla(208.89999999999998, 87.1%, 93.9%, 0.0784313725490196)"
},
-"colors-Slate-Dark-Alpha-500": {
- cssVariable: "var(--colors-slate-dark-alpha-500)",
+"colors-slate-dark-alpha-500": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-500)",
value: "hsla(200, 88.2%, 93.3%, 0.10980392156862745)"
},
-"colors-Slate-Dark-Alpha-600": {
- cssVariable: "var(--colors-slate-dark-alpha-600)",
+"colors-slate-dark-alpha-600": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-600)",
value: "hsla(209, 93.9%, 93.5%, 0.1411764705882353)"
},
-"colors-Slate-Dark-Alpha-700": {
- cssVariable: "var(--colors-slate-dark-alpha-700)",
+"colors-slate-dark-alpha-700": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-700)",
value: "hsla(203.20000000000005, 100%, 93.9%, 0.1803921568627451)"
},
-"colors-Slate-Dark-Alpha-800": {
- cssVariable: "var(--colors-slate-dark-alpha-800)",
+"colors-slate-dark-alpha-800": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-800)",
value: "hsla(208.79999999999995, 92.6%, 94.7%, 0.25882352941176473)"
},
-"colors-Slate-Dark-Alpha-900": {
- cssVariable: "var(--colors-slate-dark-alpha-900)",
+"colors-slate-dark-alpha-900": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-900)",
value: "hsla(208, 100%, 94.1%, 0.4117647058823529)"
},
-"colors-Slate-Dark-Alpha-1000": {
- cssVariable: "var(--colors-slate-dark-alpha-1000)",
+"colors-slate-dark-alpha-1000": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-1000)",
value: "hsla(210, 100%, 95.3%, 0.47058823529411764)"
},
-"colors-Slate-Dark-Alpha-1100": {
- cssVariable: "var(--colors-slate-dark-alpha-1100)",
+"colors-slate-dark-alpha-1100": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-1100)",
value: "hsla(210, 100%, 96.9%, 0.6196078431372549)"
},
-"colors-Slate-Dark-Alpha-1200": {
- cssVariable: "var(--colors-slate-dark-alpha-1200)",
+"colors-slate-dark-alpha-1200": {
+ cssVariable: "var(--core-colors-slate-dark-alpha-1200)",
value: "hsla(210, 100%, 99.6%, 0.9294117647058824)"
},
-"colors-Slate-Light-100": {
- cssVariable: "var(--colors-slate-light-100)",
+"colors-slate-light-100": {
+ cssVariable: "var(--core-colors-slate-light-100)",
value: "hsl(210, 33.3%, 98.8%)"
},
-"colors-Slate-Light-200": {
- cssVariable: "var(--colors-slate-light-200)",
+"colors-slate-light-200": {
+ cssVariable: "var(--core-colors-slate-light-200)",
value: "hsl(210, 16.7%, 97.6%)"
},
-"colors-Slate-Light-300": {
- cssVariable: "var(--colors-slate-light-300)",
+"colors-slate-light-300": {
+ cssVariable: "var(--core-colors-slate-light-300)",
value: "hsl(210, 16.7%, 95.3%)"
},
-"colors-Slate-Light-400": {
- cssVariable: "var(--colors-slate-light-400)",
+"colors-slate-light-400": {
+ cssVariable: "var(--core-colors-slate-light-400)",
value: "hsl(210, 11.8%, 93.3%)"
},
-"colors-Slate-Light-500": {
- cssVariable: "var(--colors-slate-light-500)",
+"colors-slate-light-500": {
+ cssVariable: "var(--core-colors-slate-light-500)",
value: "hsl(216, 11.1%, 91.2%)"
},
-"colors-Slate-Light-600": {
- cssVariable: "var(--colors-slate-light-600)",
+"colors-slate-light-600": {
+ cssVariable: "var(--core-colors-slate-light-600)",
value: "hsl(205.70000000000005, 12.3%, 88.8%)"
},
-"colors-Slate-Light-700": {
- cssVariable: "var(--colors-slate-light-700)",
+"colors-slate-light-700": {
+ cssVariable: "var(--core-colors-slate-light-700)",
value: "hsl(210, 11.1%, 85.9%)"
},
-"colors-Slate-Light-800": {
- cssVariable: "var(--colors-slate-light-800)",
+"colors-slate-light-800": {
+ cssVariable: "var(--core-colors-slate-light-800)",
value: "hsl(205, 10.7%, 78%)"
},
-"colors-Slate-Light-900": {
- cssVariable: "var(--colors-slate-light-900)",
+"colors-slate-light-900": {
+ cssVariable: "var(--core-colors-slate-light-900)",
value: "hsl(205.70000000000005, 6.3%, 56.1%)"
},
-"colors-Slate-Light-1000": {
- cssVariable: "var(--colors-slate-light-1000)",
+"colors-slate-light-1000": {
+ cssVariable: "var(--core-colors-slate-light-1000)",
value: "hsl(205.70000000000005, 5.7%, 52.2%)"
},
-"colors-Slate-Light-1100": {
- cssVariable: "var(--colors-slate-light-1100)",
+"colors-slate-light-1100": {
+ cssVariable: "var(--core-colors-slate-light-1100)",
value: "hsl(205.70000000000005, 6.3%, 43.5%)"
},
-"colors-Slate-Light-1200": {
- cssVariable: "var(--colors-slate-light-1200)",
+"colors-slate-light-1200": {
+ cssVariable: "var(--core-colors-slate-light-1200)",
value: "hsl(201.79999999999995, 24.4%, 8.8%)"
},
-"colors-Slate-Light-Alpha-100": {
- cssVariable: "var(--colors-slate-light-alpha-100)",
+"colors-slate-light-alpha-100": {
+ cssVariable: "var(--core-colors-slate-light-alpha-100)",
value: "hsla(209.79999999999995, 92.6%, 26.5%, 0.0196078431372549)"
},
-"colors-Slate-Light-Alpha-200": {
- cssVariable: "var(--colors-slate-light-alpha-200)",
+"colors-slate-light-alpha-200": {
+ cssVariable: "var(--core-colors-slate-light-alpha-200)",
value: "hsla(210, 87.8%, 16.1%, 0.03137254901960784)"
},
-"colors-Slate-Light-Alpha-300": {
- cssVariable: "var(--colors-slate-light-alpha-300)",
+"colors-slate-light-alpha-300": {
+ cssVariable: "var(--core-colors-slate-light-alpha-300)",
value: "hsla(209.60000000000002, 100%, 14.3%, 0.050980392156862744)"
},
-"colors-Slate-Light-Alpha-400": {
- cssVariable: "var(--colors-slate-light-alpha-400)",
+"colors-slate-light-alpha-400": {
+ cssVariable: "var(--core-colors-slate-light-alpha-400)",
value: "hsla(210.60000000000002, 93%, 11.2%, 0.0784313725490196)"
},
-"colors-Slate-Light-Alpha-500": {
- cssVariable: "var(--colors-slate-light-alpha-500)",
+"colors-slate-light-alpha-500": {
+ cssVariable: "var(--core-colors-slate-light-alpha-500)",
value: "hsla(215.29999999999995, 92.7%, 10.8%, 0.10196078431372549)"
},
-"colors-Slate-Light-Alpha-600": {
- cssVariable: "var(--colors-slate-light-alpha-600)",
+"colors-slate-light-alpha-600": {
+ cssVariable: "var(--core-colors-slate-light-alpha-600)",
value: "hsla(205.70000000000005, 96.6%, 11.4%, 0.12941176470588237)"
},
-"colors-Slate-Light-Alpha-700": {
- cssVariable: "var(--colors-slate-light-alpha-700)",
+"colors-slate-light-alpha-700": {
+ cssVariable: "var(--core-colors-slate-light-alpha-700)",
value: "hsla(209.39999999999998, 100%, 10%, 0.1607843137254902)"
},
-"colors-Slate-Light-Alpha-800": {
- cssVariable: "var(--colors-slate-light-alpha-800)",
+"colors-slate-light-alpha-800": {
+ cssVariable: "var(--core-colors-slate-light-alpha-800)",
value: "hsla(204.5, 96.1%, 10%, 0.23921568627450981)"
},
-"colors-Slate-Light-Alpha-900": {
- cssVariable: "var(--colors-slate-light-alpha-900)",
+"colors-slate-light-alpha-900": {
+ cssVariable: "var(--core-colors-slate-light-alpha-900)",
value: "hsla(206, 100%, 5.9%, 0.47058823529411764)"
},
-"colors-Slate-Light-Alpha-1000": {
- cssVariable: "var(--colors-slate-light-alpha-1000)",
+"colors-slate-light-alpha-1000": {
+ cssVariable: "var(--core-colors-slate-light-alpha-1000)",
value: "hsla(204.39999999999998, 100%, 5.3%, 0.5098039215686274)"
},
-"colors-Slate-Light-Alpha-1100": {
- cssVariable: "var(--colors-slate-light-alpha-1100)",
+"colors-slate-light-alpha-1100": {
+ cssVariable: "var(--core-colors-slate-light-alpha-1100)",
value: "hsla(205, 100%, 4.7%, 0.5882352941176471)"
},
-"colors-Slate-Light-Alpha-1200": {
- cssVariable: "var(--colors-slate-light-alpha-1200)",
+"colors-slate-light-alpha-1200": {
+ cssVariable: "var(--core-colors-slate-light-alpha-1200)",
value: "hsla(200, 100%, 2.4%, 0.9294117647058824)"
},
"variables-colors-brand-primary": {
- cssVariable: "var(--variables-colors-brand-primary)",
+ cssVariable: "var(--core-variables-colors-brand-primary)",
value: "hsl(153.10000000000002, 60.2%, 52.7%)"
},
"variables-colors-brand-accent": {
- cssVariable: "var(--variables-colors-brand-accent)",
+ cssVariable: "var(--core-variables-colors-brand-accent)",
value: "hsl(152.89999999999998, 56.1%, 46.5%)"
},
"foreground-DEFAULT": {
@@ -409,75 +409,99 @@ module.exports = {
},
"foreground-light": {
cssVariable: "var(--foreground-light)",
- value: "hsl(0, 0%, 62.7%)"
+ value: "hsl(0, 0%, 69%)"
},
"foreground-lighter": {
cssVariable: "var(--foreground-lighter)",
- value: "hsl(0, 0%, 49.4%)"
+ value: "hsl(197.10000000000002, 3.1%, 55.9%)"
},
"foreground-muted": {
cssVariable: "var(--foreground-muted)",
- value: "hsl(0, 0%, 43.9%)"
+ value: "hsl(198, 5.4%, 36.1%)"
+},
+"foreground-contrast": {
+ cssVariable: "var(--foreground-contrast)",
+ value: "hsl(201.79999999999995, 16.9%, 12.7%)"
},
"background-DEFAULT": {
cssVariable: "var(--background-default)",
- value: "hsl(0, 0%, 11%)"
+ value: "hsl(200, 11.1%, 5.3%)"
},
"background-alternative": {
cssVariable: "var(--background-alternative)",
- value: "hsl(0, 0%, 8.6%)"
+ value: "hsl(200, 20%, 2.9%)"
},
"background-selection": {
cssVariable: "var(--background-selection)",
- value: "hsl(0, 0%, 20.4%)"
+ value: "hsl(192, 9.8%, 10%)"
},
"background-control": {
cssVariable: "var(--background-control)",
- value: "hsl(0, 0%, 13.7%)"
+ value: "hsl(192, 9.4%, 10.4%)"
},
"background-surface-100": {
cssVariable: "var(--background-surface-100)",
- value: "hsl(0, 0%, 13.7%)"
+ value: "hsl(195, 10%, 7.8%)"
},
"background-surface-200": {
cssVariable: "var(--background-surface-200)",
- value: "hsl(0, 0%, 15.7%)"
+ value: "hsl(192, 9.1%, 10.8%)"
},
"background-surface-300": {
cssVariable: "var(--background-surface-300)",
- value: "hsl(0, 0%, 18%)"
+ value: "hsl(202.5, 10.5%, 14.9%)"
+},
+"background-surface-_contrast-300": {
+ cssVariable: "var(--background-surface-contrast-300)",
+ value: "hsl(202.5, 10.5%, 14.9%)"
},
"background-overlay-DEFAULT": {
cssVariable: "var(--background-overlay-default)",
- value: "hsl(0, 0%, 13.7%)"
+ value: "hsl(192, 14.3%, 6.9%)"
},
"background-overlay-hover": {
cssVariable: "var(--background-overlay-hover)",
- value: "hsl(0, 0%, 18%)"
+ value: "hsl(190, 10.7%, 11%)"
+},
+"background-secondary": {
+ cssVariable: "var(--background-secondary)",
+ value: "hsl(0, 0%, 100%)"
+},
+"background-muted": {
+ cssVariable: "var(--background-muted)",
+ value: "hsl(0, 0%, 100%)"
},
"border-DEFAULT": {
cssVariable: "var(--border-default)",
- value: "hsl(0, 0%, 18%)"
+ value: "hsl(186, 17.9%, 11%)"
},
"border-muted": {
cssVariable: "var(--border-muted)",
- value: "hsl(0, 0%, 15.7%)"
+ value: "hsl(197.10000000000002, 14.9%, 9.2%)"
},
"border-secondary": {
cssVariable: "var(--border-secondary)",
- value: "hsl(0, 0%, 15.7%)"
+ value: "hsl(196.39999999999998, 21.6%, 10%)"
},
"border-overlay": {
cssVariable: "var(--border-overlay)",
- value: "hsl(0, 0%, 15.7%)"
+ value: "hsl(186.70000000000005, 33.3%, 5.3%)"
},
"border-control": {
cssVariable: "var(--border-control)",
- value: "hsl(0, 0%, 20.4%)"
+ value: "hsl(180, 9.1%, 12.9%)"
},
"border-alternative": {
cssVariable: "var(--border-alternative)",
- value: "hsl(0, 0%, 18%)"
+ value: "hsl(190.89999999999998, 16.4%, 13.1%)"
+},
+"border-strong": {
+ cssVariable: "var(--border-strong)",
+ value: "hsl(188, 16.5%, 17.8%)"
+},
+"border-stronger": {
+ cssVariable: "var(--border-stronger)",
+ value: "hsl(190, 16.1%, 22%)"
},
"destructive-200": {
cssVariable: "var(--destructive-200)",
@@ -529,26 +553,34 @@ module.exports = {
},
"brand-200": {
cssVariable: "var(--brand-200)",
- value: "hsl(152.5, 75%, 6.3%)"
+ value: "hsl(162, 100%, 2%)"
},
"brand-300": {
cssVariable: "var(--brand-300)",
- value: "hsl(153.79999999999995, 69.6%, 9%)"
+ value: "hsl(158.39999999999998, 100%, 4.9%)"
},
"brand-400": {
cssVariable: "var(--brand-400)",
- value: "hsl(153.29999999999995, 65.2%, 13.5%)"
+ value: "hsl(160.39999999999998, 100%, 9.6%)"
},
"brand-500": {
cssVariable: "var(--brand-500)",
- value: "hsl(153.5, 61.8%, 21.6%)"
+ value: "hsl(160.39999999999998, 100%, 19.2%)"
},
"brand-600": {
cssVariable: "var(--brand-600)",
- value: "hsl(153, 59.5%, 70%)"
+ value: "hsl(176, 59.5%, 70%)"
},
"brand-DEFAULT": {
cssVariable: "var(--brand-default)",
- value: "hsl(152.89999999999998, 60%, 52.9%)"
+ value: "hsl(159.89999999999998, 100%, 38.6%)"
+},
+"brand-accent": {
+ cssVariable: "var(--brand-accent)",
+ value: "hsl(160, 100%, 50%)"
+},
+"secondary": {
+ cssVariable: "var(--secondary)",
+ value: "hsl(0, 0%, 100%)"
}
}
\ No newline at end of file
diff --git a/packages/ui/internals/tokens/build-tokens.js b/packages/ui/internals/tokens/build-tokens.js
deleted file mode 100644
index edb0f90ac07..00000000000
--- a/packages/ui/internals/tokens/build-tokens.js
+++ /dev/null
@@ -1,265 +0,0 @@
-const glob = require('glob')
-
-const configFiles = glob.sync(`tokens/config/**/*.json`)
-const sourceFiles = glob.sync(`tokens/source/**/*.json`)
-const themeFiles = glob.sync(`tokens/themes/**/*.json`)
-const semanticFiles = glob.sync(`tokens/semantic/**/*.json`)
-
-const { registerTransforms } = require('@tokens-studio/sd-transforms')
-const StyleDictionary = require('style-dictionary')
-
-const Color = require('color')
-
-/**
- * uncomment tailwind types as they become available
- */
-const supportedTokenTypeList = [
- // 'spacing',
- // 'sizing',
- // 'borderRadius',
- // 'borderWidth',
- 'color',
- // 'opacity',
- // 'fontFamilies',
- // 'lineHeights',
- // 'letterSpacing',
- // 'paragraphSpacing',
- // 'fontWeights',
- // 'fontSizes',
- // 'textCase',
- // 'textDecoration',
-]
-
-registerTransforms(StyleDictionary)
-
-const formatTailwindValue = (tokenType, value) => {
- let formattedValue
- switch (tokenType) {
- case 'color':
- default:
- formattedValue = value
- }
- return formattedValue
-}
-
-/**
- * Custom format that generates tailwind friendly colors so we can add <alpha-value>
- * in the config later
- * https://tailwindcss.com/docs/customizing-colors#using-css-variables
- */
-StyleDictionary.registerTransform({
- name: 'color/rgb',
- type: 'value',
- matcher: (prop) => prop.type === 'color',
- transformer: (prop) => {
- if (!prop.original.value) {
- console.error(`No colorvalue detected for ${prop.name}.`)
- }
-
- if (prop.original.value === '#') {
- console.error(`Only "#" as value for ${prop.name}. Must use a correct format like "#FFF"`)
- }
-
- const color = Color(prop?.original?.value)
-
- if (!color) {
- console.error('No color')
- }
-
- console.log(color)
-
- const hsl = Color(prop?.original?.value).hsl()
- return hsl.string()
- },
-})
-
-/**
- * Custom format that generate tailwind color config based on css variables
- */
-StyleDictionary.registerFormat({
- name: 'tw/css-variables',
- formatter({ dictionary }) {
- // console.log('dictionary', dictionary)
- return (
- 'module.exports = ' +
- `{\n${dictionary.allProperties
- .map((token) => {
- const value = formatTailwindValue(token.type, token.value)
- return `"${token.path.slice(0).join('-')}": {
- cssVariable: "var(--${token.name})",
- value: "${value}"
-}`
- })
- .join(',\n')}\n}`
- )
- },
-})
-
-/**
- * Returns the files configuration
- * for generating separated tailwind files.
- */
-function getConfigTailwindFilesByType(typeList) {
- console.log('\n')
- console.log('tailwind typeList', typeList)
- return typeList.map((typeName) => {
- return {
- destination: `tw-extend/${typeName}.js`,
- format: 'tw/css-variables',
- filter: {
- type: typeName,
- },
- }
- })
-}
-
-function getStyleDictionaryConfig(
- source,
- fileName,
- type,
- buildTailwindFiles = false,
- rootTheme = false,
- filePath
-) {
- console.log('about to run', source, fileName)
-
- let configTailwindFilesByType = []
-
- if (buildTailwindFiles) {
- console.log(`\n`)
- console.log(`Generating Tailwind Props ✨`)
- configTailwindFilesByType = getConfigTailwindFilesByType(supportedTokenTypeList)
- }
-
- return {
- source: [...source],
- platforms: {
- css: {
- // transformGroup: 'tokens-studio',
- transforms: [
- 'ts/descriptionToComment',
- 'ts/size/px',
- 'ts/opacity',
- 'ts/size/lineheight',
- 'ts/type/fontWeight',
- 'ts/resolveMath',
- 'ts/size/css/letterspacing',
- 'ts/typography/css/shorthand',
- 'ts/border/css/shorthand',
- 'ts/shadow/css/shorthand',
- 'ts/color/css/hexrgba',
- 'ts/color/modifiers',
- 'name/cti/kebab',
- 'color/rgb',
- ],
- buildPath: 'build/css/',
- files: [
- {
- destination: `${type}/${fileName}.css`,
- format: 'css/variables',
- options: {
- selector: rootTheme ? ':root' : `.${fileName}`,
- outputReferences: true,
- },
- filter: (token) => token.filePath === filePath,
- },
- ...configTailwindFilesByType,
- ],
- },
- },
- }
-}
-
-function fileNameCleaner(fileName) {
- return fileName.split('/').pop().replace('.json', '')
-}
-
-/**
- * BUILD SOURCE FILES
- */
-
-sourceFiles.map(function (filePath) {
- const fileName = fileNameCleaner(filePath)
- const SD = StyleDictionary.extend(
- getStyleDictionaryConfig([filePath], fileName, 'source', true, true, filePath)
- )
- SD.buildAllPlatforms()
-})
-
-/**
- * BUILD THEME FILE
- */
-
-themeFiles.map(function (filePath, i) {
- const buildTailwindFiles = filePath.includes('dark') // i === 0
- const fileName = fileNameCleaner(filePath)
- const rootTheme = filePath.includes('dark')
- const SD = StyleDictionary.extend(
- getStyleDictionaryConfig(
- // determine whether to include the root theme properties with each theme
- [...sourceFiles, filePath],
- rootTheme ? 'dark' : fileName,
- 'themes',
- buildTailwindFiles,
- false,
- filePath
- )
- )
- SD.buildAllPlatforms()
-})
-
-function convertToVariableIfNeeded(value) {
- if (value.startsWith('{') && value.endsWith('}')) {
- return `var(--${value.slice(1, -1).split('.').join('-')})`
- }
- return value
-}
-
-/**
- * BUILD TYPOGRAPHY FILES
- */
-
-/**
- * Format for css typography classes
- * This generates theme-independent css classes so we're fine with just using css variables here
- */
-StyleDictionary.registerFormat({
- name: 'css/typographyClasses',
- formatter: (dictionary, config) =>
- dictionary.allProperties
- .map((prop) => {
- return `
-.${prop.name} {
- font: var(--${prop.name});
- letter-spacing: ${convertToVariableIfNeeded(prop.original.value.letterSpacing)};
- text-transform: ${convertToVariableIfNeeded(prop.original.value.textCase)};
- text-decoration: ${convertToVariableIfNeeded(prop.original.value.textDecoration)};
-}`
- })
- .join('\n'),
-})
-
-function getTypographyConfig() {
- console.log('Building: typography')
- return {
- source: [...semanticFiles, ...sourceFiles],
- platforms: {
- css: {
- transforms: ['name/cti/kebab'],
- transformGroup: 'tokens-studio',
- buildPath: 'build/css/',
- files: [
- {
- destination: `source/typography-classes.css`,
- format: 'css/typographyClasses',
- selector: ':root',
- filter: (token) => token.type === 'typography',
- },
- ],
- },
- },
- }
-}
-
-const typographyBuild = StyleDictionary.extend(getTypographyConfig())
-typographyBuild.buildAllPlatforms()
diff --git a/packages/ui/internals/tokens/cleanse-css-for-tailwind.js b/packages/ui/internals/tokens/cleanse-css-for-tailwind.js
index 0a20c460227..fd32e56b91b 100644
--- a/packages/ui/internals/tokens/cleanse-css-for-tailwind.js
+++ b/packages/ui/internals/tokens/cleanse-css-for-tailwind.js
@@ -3,11 +3,14 @@ const fs = require('fs')
const cssFiles = glob.sync('build/css/**/*.css')
-function transformHSLValues(precision) {
+function transformCssFiles(precision) {
cssFiles.forEach((file) => {
const css = fs.readFileSync(file, 'utf8')
- const transformedCss = css.replace(
+ let transformedCss = css
+
+ // transform hsl values to degrees, percentages
+ transformedCss = transformedCss.replace(
/hsl\(([\d.]+)[,\s]+([\d.]+)%[,\s]+([\d.]+)%\)/g,
(match, hue, saturation, lightness) => {
hue = `${roundNumber(hue, precision)}deg`
@@ -17,6 +20,9 @@ function transformHSLValues(precision) {
}
)
+ // remove --core prefix from files
+ transformedCss = transformedCss.replace(/--core-/g, '--')
+
fs.writeFileSync(file, transformedCss)
})
@@ -32,4 +38,4 @@ function transformHSLValues(precision) {
}
// Example usage:
-transformHSLValues(1)
+transformCssFiles(1)
diff --git a/packages/ui/internals/tokens/copy-tokens.js b/packages/ui/internals/tokens/copy-tokens.js
deleted file mode 100644
index afee1fa902b..00000000000
--- a/packages/ui/internals/tokens/copy-tokens.js
+++ /dev/null
@@ -1,95 +0,0 @@
-const https = require('https')
-const fs = require('fs')
-
-/*
- * Branch to target in GitHub repo
- */
-const branch = 'feat/figma-variables' // 'feat/new-components'
-// using Math.random() in a param as GitHub caches raw content
-// const url = `https://raw.githubusercontent.com/MildTomato/supabase-design-tokens/${branch}/tokens.json?e=${Math.random()}`
-const baseUrl = `https://raw.githubusercontent.com/MildTomato/supabase-design-tokens/${branch}/tokens/`
-
-console.log(baseUrl)
-/*
- * Files that need to be copied over from Tokens repo
- */
-const TOKEN_FILES_METADATA = [
- // figma tokens misc config files (comment out for now)
- // { fileName: '$metadata.json', type: 'config' },
- // { fileName: '$themes.json', type: 'config' },
- // source files (comment out for now)
- { fileName: 'global.json', type: 'source', subdirectory: '' },
- // { fileName: 'global-two.json', type: 'source' },
- // semantic (comment out for now)
- // { fileName: 'typography.json', type: 'semantic' },
- // themes
- // { fileName: 'root.json', type: 'theme', subdirectory: 'new/' }, // root theme
- { fileName: 'dark.json', type: 'theme', subdirectory: 'new/' },
- { fileName: 'light.json', type: 'theme', subdirectory: 'new/' },
- // { fileName: 'darker-dark.json', type: 'theme', subdirectory: 'new/' },
-]
-
-const PATHS = {
- config: 'config/',
- source: 'source/',
- theme: 'themes/',
- semantic: 'semantic/',
-}
-
-async function getTokensFile() {
- const promises = TOKEN_FILES_METADATA.map((tokenMetadata, i) => {
- return new Promise((resolve, reject) => {
- console.log(
- 'URL being copied',
- baseUrl +
- tokenMetadata.subdirectory +
- tokenMetadata.fileName +
- `?e=${Math.floor(Math.random() * 1000000)}`
- )
- https
- .get(
- baseUrl +
- tokenMetadata.subdirectory +
- tokenMetadata.fileName +
- `?e=${Math.floor(Math.random() * 1000000)}`,
- (res) => {
- // console.log('res', res)
- let data = ''
- res.on('data', (chunk) => {
- data += chunk
- })
- res.on('end', () => {
- console.log(
- 'should save to ',
- `./tokens/${PATHS[tokenMetadata.type]}${tokenMetadata.fileName}`
- )
- fs.writeFile(
- `./tokens/${PATHS[tokenMetadata.type]}${tokenMetadata.fileName}`,
- data,
- 'utf8',
- () => {}
- )
- resolve(data)
- })
- }
- )
- .on('error', (err) => {
- reject(err)
- })
- })
- })
-
- await Promise.all(promises)
-}
-
-async function copyFiles() {
- console.log('Copying token files... \n')
- console.log('branch to pull is:', branch)
- try {
- await getTokensFile()
- } catch (error) {
- console.error(error)
- }
-}
-
-copyFiles()
diff --git a/packages/ui/internals/tokens/extract-design-tokens.js b/packages/ui/internals/tokens/extract-design-tokens.js
new file mode 100644
index 00000000000..f3df5758ef1
--- /dev/null
+++ b/packages/ui/internals/tokens/extract-design-tokens.js
@@ -0,0 +1,47 @@
+const fs = require('fs')
+const path = require('path')
+
+// Read the JSON file
+try {
+ const rawData = fs.readFileSync('./tokens/design-tokens.tokens.json')
+ const jsonData = JSON.parse(rawData)
+
+ // Extract "core"
+ const coreData = jsonData.core
+
+ // Specify output directories
+ const coreDirectory = path.join(__dirname, './../../tokens/core')
+ const themesDirectory = path.join(__dirname, './../../tokens/themes')
+
+ // Check if directories exist, create them if not
+ if (!fs.existsSync(coreDirectory)) {
+ fs.mkdirSync(coreDirectory)
+ console.log(`Created directory: ${coreDirectory}`)
+ }
+
+ if (!fs.existsSync(themesDirectory)) {
+ fs.mkdirSync(themesDirectory)
+ console.log(`Created directory: ${themesDirectory}`)
+ }
+
+ // Write "core" to a separate JSON file
+ fs.writeFileSync(
+ path.join(coreDirectory, 'core.json'),
+ JSON.stringify({ core: coreData }, null, 2)
+ )
+ console.log('Core file written successfully.')
+
+ // Extract and write each theme to separate JSON files
+ const themes = jsonData.theme
+
+ Object.keys(themes).forEach((themeName) => {
+ const themeData = themes[themeName]
+ const themeFileName = path.join(themesDirectory, `${themeName}.json`)
+ fs.writeFileSync(themeFileName, JSON.stringify(themeData, null, 2))
+ console.log(`Theme file "${themeName}.json" written successfully.`)
+ })
+
+ console.log('Extraction completed!')
+} catch (error) {
+ console.error('Error:', error.message)
+}
diff --git a/packages/ui/internals/tokens/generate-demo-tailwind-classes.js b/packages/ui/internals/tokens/generate-demo-tailwind-classes.js
index 5c40d258d10..e609e8251f6 100644
--- a/packages/ui/internals/tokens/generate-demo-tailwind-classes.js
+++ b/packages/ui/internals/tokens/generate-demo-tailwind-classes.js
@@ -23,10 +23,10 @@ function writeJsFile(file) {
)
const palletes = Object.keys(color).filter((x) => x.includes('colors-'))
- console.log('Example tailwind classes: ')
+ // console.log('Example tailwind classes: ')
function santizieDefaults(x) {
- console.log(x)
+ // console.log(x)
let value = x
value = value.replace('-DEFAULT', '')
value = value.replace('background', 'bg')
diff --git a/packages/ui/internals/transform/common/camelCaseHelper.js b/packages/ui/internals/transform/common/camelCaseHelper.js
new file mode 100644
index 00000000000..69d260dca17
--- /dev/null
+++ b/packages/ui/internals/transform/common/camelCaseHelper.js
@@ -0,0 +1,3 @@
+const changeCase = require('change-case')
+
+module.exports = name => changeCase.camelCase(name, { transform: changeCase.camelCaseTransformMerge })
diff --git a/packages/ui/internals/transform/common/colorToHex8.js b/packages/ui/internals/transform/common/colorToHex8.js
new file mode 100644
index 00000000000..42b6fd71ac7
--- /dev/null
+++ b/packages/ui/internals/transform/common/colorToHex8.js
@@ -0,0 +1,11 @@
+const TinyColor = require('@ctrl/tinycolor')
+
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'color'
+ },
+ transformer: function ({ value }) {
+ return `${new TinyColor.TinyColor(value).toHex8String()}`
+ }
+}
diff --git a/packages/ui/internals/transform/common/colorToRgbaString.js b/packages/ui/internals/transform/common/colorToRgbaString.js
new file mode 100644
index 00000000000..01819adbede
--- /dev/null
+++ b/packages/ui/internals/transform/common/colorToRgbaString.js
@@ -0,0 +1,11 @@
+const TinyColor = require('@ctrl/tinycolor')
+
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'color'
+ },
+ transformer: function ({ value }) {
+ return `${new TinyColor.TinyColor(value).toRgbString()}`
+ }
+}
diff --git a/packages/ui/internals/transform/common/copyFileOrFolder.js b/packages/ui/internals/transform/common/copyFileOrFolder.js
new file mode 100644
index 00000000000..62ba766a3b6
--- /dev/null
+++ b/packages/ui/internals/transform/common/copyFileOrFolder.js
@@ -0,0 +1,16 @@
+const fs = require('fs-extra')
+
+module.exports = {
+ do: function (dictionary, config) {
+ config.options.copyFilesAction.forEach(({ destination, origin }) => {
+ console.log(`Copying ${origin} to ${destination}`)
+ fs.copySync(origin, destination)
+ })
+ },
+ undo: function (dictionary, config) {
+ config.options.copyFilesAction.forEach(({ destination, origin }) => {
+ console.log(`Cleaning ${destination}`)
+ fs.removeSync(destination)
+ })
+ }
+}
diff --git a/packages/ui/internals/transform/web/createPropertyFormatter.js b/packages/ui/internals/transform/web/createPropertyFormatter.js
new file mode 100644
index 00000000000..31687131d6a
--- /dev/null
+++ b/packages/ui/internals/transform/web/createPropertyFormatter.js
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+const defaultFormatting = {
+ prefix: '',
+ commentStyle: 'long',
+ indentation: '',
+ separator: ' =',
+ suffix: ';'
+}
+
+/**
+ * Creates a function that can be used to format a property. This can be useful
+ * to use as the function on `dictionary.allTokens.map`. The formatting
+ * is configurable either by supplying a `format` option or a `formatting` object
+ * which uses: prefix, indentation, separator, suffix, and commentStyle.
+ * @memberof module:formatHelpers
+ * @example
+ * ```javascript
+ * StyleDictionary.registerFormat({
+ * name: 'myCustomFormat',
+ * formatter: function({ dictionary, options }) {
+ * const { outputReferences } = options;
+ * const formatProperty = createPropertyFormatter({
+ * outputReferences,
+ * dictionary,
+ * format: 'css'
+ * });
+ * return dictionary.allTokens.map(formatProperty).join('\n');
+ * }
+ * });
+ * ```
+ * @param {Object} options
+ * @param {Boolean} options.outputReferences - Whether or not to output references. You will want to pass this from the `options` object sent to the formatter function.
+ * @param {Dictionary} options.dictionary - The dictionary object sent to the formatter function
+ * @param {String} options.format - Available formats are: 'css', 'sass', 'less', and 'stylus'. If you want to customize the format and can't use one of those predefined formats, use the `formatting` option
+ * @param {Object} options.formatting - Custom formatting properties that define parts of a declaration line in code. The configurable strings are: prefix, indentation, separator, suffix, and commentStyle. Those are used to generate a line like this: `${indentation}${prefix}${prop.name}${separator} ${prop.value}${suffix}`
+ * @returns {Function}
+ */
+function createPropertyFormatter({outputReferences, dictionary, format, formatting={}}) {
+ let {prefix, commentStyle, indentation, separator, suffix} = Object.assign({}, defaultFormatting, formatting);
+
+ switch(format) {
+ case 'css':
+ prefix = '--';
+ indentation = ' ';
+ separator = ':';
+ break;
+ case 'sass':
+ prefix = '$';
+ commentStyle = 'short';
+ indentation = '';
+ separator = ':';
+ break;
+ case 'less':
+ prefix = '@';
+ commentStyle = 'short';
+ indentation = '';
+ separator = ':';
+ break;
+ case 'stylus':
+ prefix = '$';
+ commentStyle = 'short';
+ indentation = '';
+ separator = '=';
+ break;
+ }
+
+ return function(prop) {
+ let to_ret_prop = `${indentation}${prefix}${prop.name}${separator} `.replace('--dark-', '--').replace('--light-', '--');
+ let value = prop.value;
+
+ /**
+ * A single value can have multiple references either by interpolation:
+ * "value": "{size.border.width.value} solid {color.border.primary.value}"
+ * or if the value is an object:
+ * "value": {
+ * "size": "{size.border.width.value}",
+ * "style": "solid",
+ * "color": "{color.border.primary.value"}
+ * }
+ * This will see if there are references and if there are, replace
+ * the resolved value with the reference's name.
+ */
+ if (outputReferences && dictionary.usesReference(prop.original.value)) {
+ // Formats that use this function expect `value` to be a string
+ // or else you will get '[object Object]' in the output
+ if (typeof value === 'string') {
+ const refs = dictionary.getReferences(prop.original.value);
+ refs.forEach(ref => {
+ // value should be a string that contains the resolved reference
+ // because Style Dictionary resolved this in the resolution step.
+ // Here we are undoing that by replacing the value with
+ // the reference's name
+ if (ref.value && ref.name) {
+ value = value.replace(ref.value, function() {
+ if (format === 'css') {
+ return `var(${prefix}${ref.name})`
+ } else {
+ return `${prefix}${ref.name}`;
+ }
+ });
+ }
+ });
+ }
+ }
+
+ to_ret_prop += prop.attributes.category === 'asset' ? `"${value}"` : value;
+
+ if (format == 'sass' && prop.themeable === true) {
+ to_ret_prop += ' !default';
+ }
+
+ to_ret_prop += suffix;
+
+ if (prop.comment && commentStyle !== 'none') {
+ if (commentStyle === 'short') {
+ to_ret_prop = to_ret_prop.concat(` // ${prop.comment}`);
+ } else {
+ to_ret_prop = to_ret_prop.concat(` /* ${prop.comment} */`);
+ }
+ }
+
+ return to_ret_prop;
+ }
+}
+
+module.exports = createPropertyFormatter;
diff --git a/packages/ui/internals/transform/web/fileHeader.js b/packages/ui/internals/transform/web/fileHeader.js
new file mode 100644
index 00000000000..153922ace66
--- /dev/null
+++ b/packages/ui/internals/transform/web/fileHeader.js
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+// no-op default
+const defaultFileHeader = (arr) => arr
+
+const lineSeparator = '\n'
+const defaultFormatting = {
+ lineSeparator,
+ prefix: ' * ',
+ header: `/**${lineSeparator}`,
+ footer: `${lineSeparator} */${lineSeparator}${lineSeparator}`
+}
+
+/**
+ *
+ * This is for creating the comment at the top of generated files with the generated at date.
+ * It will use the custom file header if defined on the configuration, or use the
+ * default file header.
+ * @memberof module:formatHelpers
+ * @param {Object} options
+ * @param {File} options.file - The file object that is passed to the formatter.
+ * @param {String} options.commentStyle - The only options are 'short' and 'xml', which will use the // or \<!-- --> style comments respectively. Anything else will use \/\* style comments.
+ * @param {Object} options.formatting - Custom formatting properties that define parts of a comment in code. The configurable strings are: prefix, lineSeparator, header, and footer.
+ * @returns {String}
+ * @example
+ * ```js
+ * StyleDictionary.registerFormat({
+ * name: 'myCustomFormat',
+ * formatter: function({ dictionary, file }) {
+ * return fileHeader({file, 'short') +
+ * dictionary.allTokens.map(token => `${token.name} = ${token.value}`)
+ * .join('\n');
+ * }
+ * });
+ * ```
+ */
+function fileHeader ({ file = {}, commentStyle, formatting = {} }) {
+ // showFileHeader is true by default
+ let showFileHeader = true
+ if (file.options && typeof file.options.showFileHeader !== 'undefined') {
+ showFileHeader = file.options.showFileHeader
+ }
+
+ // Return empty string if the showFileHeader is false
+ if (!showFileHeader) return ''
+
+ let fn = defaultFileHeader
+ if (file.options && typeof file.options.fileHeader === 'function') {
+ fn = file.options.fileHeader
+ }
+
+ // default header
+ const defaultHeader = [
+ 'Do not edit directly',
+ `Generated on ${new Date().toString()}`
+ ]
+
+ let { prefix, lineSeparator, header, footer } = Object.assign({}, defaultFormatting, formatting)
+
+ if (commentStyle === 'short') {
+ prefix = '// '
+ header = `${lineSeparator}`
+ footer = `${lineSeparator}${lineSeparator}`
+ } else if (commentStyle === 'xml') {
+ prefix = ' '
+ header = `<!--${lineSeparator}`
+ footer = `${lineSeparator}-->`
+ }
+
+ return `${header}${fn(defaultHeader)
+ .map(line => `${prefix}${line}`)
+ .join(lineSeparator)}${footer}`
+}
+
+module.exports = fileHeader
diff --git a/packages/ui/internals/transform/web/filterWeb.js b/packages/ui/internals/transform/web/filterWeb.js
new file mode 100644
index 00000000000..6246ae733d1
--- /dev/null
+++ b/packages/ui/internals/transform/web/filterWeb.js
@@ -0,0 +1,3 @@
+const acceptedTypes = ['color', 'dimension', 'font', 'custom-radius', 'custom-fontStyle', 'custom-shadow', 'custom-gradient']
+
+module.exports = (token) => acceptedTypes.includes(token.type)
diff --git a/packages/ui/internals/transform/web/formatCss.js b/packages/ui/internals/transform/web/formatCss.js
new file mode 100644
index 00000000000..87fec87c828
--- /dev/null
+++ b/packages/ui/internals/transform/web/formatCss.js
@@ -0,0 +1,45 @@
+const formattedVariables = require('./formattedVariables')
+const fileHeader = require('./fileHeader')
+
+const filteredTokens = (dictionary, filterFn) => {
+ const filtered = dictionary.allTokens.filter(token => filterFn(token))
+ return {
+ ...dictionary,
+ ...{
+ allProperties: filtered,
+ allTokens: filtered
+ }
+ }
+}
+
+module.exports = ({ dictionary, options, file }) => {
+ const opts = options ?? {}
+ const { outputReferences } = opts
+ const groupedTokens = {
+ // if you export the prefixes use token.path[0] instead of [1]
+ light: filteredTokens(dictionary, (token) => token.path[1].toLowerCase() === 'light'),
+ dark: filteredTokens(dictionary, (token) => token.path[1].toLowerCase() === 'dark'),
+ rest: filteredTokens(dictionary, (token) => !['light', 'dark'].includes(token.path[1].toLowerCase()))
+ }
+
+ return (
+ fileHeader({ file }) +
+ ':root {\n' +
+ formattedVariables({ format: 'css', dictionary: groupedTokens.rest, outputReferences }) +
+ '\n}\n\n' +
+ '@media (prefers-color-scheme: light) {\n' +
+ ' :root {\n' +
+ formattedVariables({ format: 'css', dictionary: groupedTokens.light, outputReferences }) +
+ '\n }\n}\n\n' +
+ '@media (prefers-color-scheme: dark) {\n' +
+ ' :root {\n' +
+ formattedVariables({ format: 'css', dictionary: groupedTokens.dark, outputReferences }) +
+ '\n }\n}\n\n' +
+ 'html[data-theme="light"] {\n' +
+ formattedVariables({ format: 'css', dictionary: groupedTokens.light, outputReferences }) +
+ '\n}\n\n' +
+ 'html[data-theme="dark"] {\n' +
+ formattedVariables({ format: 'css', dictionary: groupedTokens.dark, outputReferences }) +
+ '\n}\n'
+ )
+}
diff --git a/packages/ui/internals/transform/web/formattedVariables.js b/packages/ui/internals/transform/web/formattedVariables.js
new file mode 100644
index 00000000000..b73b817b382
--- /dev/null
+++ b/packages/ui/internals/transform/web/formattedVariables.js
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+const createPropertyFormatter = require('./createPropertyFormatter')
+const sortByReference = require('./sortByReference')
+
+const defaultFormatting = {
+ lineSeparator: '\n'
+}
+
+/**
+ *
+ * This is used to create lists of variables like Sass variables or CSS custom properties
+ * @memberof module:formatHelpers
+ * @param {Object} options
+ * @param {String} options.format - What type of variables to output. Options are: css, sass, less, and stylus
+ * @param {Object} options.dictionary - The dictionary object that gets passed to the formatter method.
+ * @param {Boolean} options.outputReferences - Whether or not to output references
+ * @param {Object} options.formatting - Custom formatting properties that define parts of a declaration line in code. This will get passed to `formatHelpers.createPropertyFormatter` and used for the `lineSeparator` between lines of code.
+ * @returns {String}
+ * @example
+ * ```js
+ * StyleDictionary.registerFormat({
+ * name: 'myCustomFormat',
+ * formatter: function({ dictionary, options }) {
+ * return formattedVariables('less', dictionary, options.outputReferences);
+ * }
+ * });
+ * ```
+ */
+function formattedVariables ({ format, dictionary, outputReferences = false, formatting = {} }) {
+ let { allTokens } = dictionary
+
+ const { lineSeparator } = Object.assign({}, defaultFormatting, formatting)
+
+ // Some languages are imperative, meaning a variable has to be defined
+ // before it is used. If `outputReferences` is true, check if the token
+ // has a reference, and if it does send it to the end of the array.
+ // We also need to account for nested references, a -> b -> c. They
+ // need to be defined in reverse order: c, b, a so that the reference always
+ // comes after the definition
+ if (outputReferences) {
+ // note: using the spread operator here so we get a new array rather than
+ // mutating the original
+ allTokens = [...allTokens].sort(sortByReference(dictionary))
+ }
+
+ return allTokens
+ .map(createPropertyFormatter({ outputReferences, dictionary, format, formatting }))
+ .filter(function (strVal) { return !!strVal })
+ .join(lineSeparator)
+}
+
+module.exports = formattedVariables
diff --git a/packages/ui/internals/transform/web/index.js b/packages/ui/internals/transform/web/index.js
new file mode 100644
index 00000000000..f512415c131
--- /dev/null
+++ b/packages/ui/internals/transform/web/index.js
@@ -0,0 +1,29 @@
+const StyleDictionary = require('style-dictionary')
+
+module.exports = {
+ transform: {
+ 'size/px': require('./sizePx'),
+ 'web/shadow': require('./webShadows'),
+ 'web/radius': require('./webRadius'),
+ 'web/padding': require('./webPadding'),
+ 'web/font': require('./webFont'),
+ 'web/gradient': require('./webGradient'),
+ 'color/hex8ToRgba': require('../common/colorToRgbaString'),
+ },
+ transformGroup: {
+ 'custom/css': StyleDictionary.transformGroup.css.concat([
+ 'size/px',
+ 'web/shadow',
+ 'web/radius',
+ 'web/padding',
+ 'web/font',
+ 'web/gradient',
+ 'color/hex8ToRgba',
+ 'color/rgb',
+ ]),
+ },
+ format: {
+ 'custom/css': require('./formatCss'),
+ },
+ action: {},
+}
diff --git a/packages/ui/internals/transform/web/sizePx.js b/packages/ui/internals/transform/web/sizePx.js
new file mode 100644
index 00000000000..b19899f0b86
--- /dev/null
+++ b/packages/ui/internals/transform/web/sizePx.js
@@ -0,0 +1,9 @@
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'dimension' && token.value !== 0
+ },
+ transformer: function (token) {
+ return `${token.value}px`
+ }
+}
diff --git a/packages/ui/internals/transform/web/sortByReference.js b/packages/ui/internals/transform/web/sortByReference.js
new file mode 100644
index 00000000000..16eeb80a248
--- /dev/null
+++ b/packages/ui/internals/transform/web/sortByReference.js
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
+ * the License. A copy of the License is located at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+/**
+ * A function that returns a sorting function to be used with Array.sort that
+ * will sort the allTokens array based on references. This is to make sure
+ * if you use output references that you never use a reference before it is
+ * defined.
+ * @memberof module:formatHelpers
+ * @example
+ * ```javascript
+ * dictionary.allTokens.sort(sortByReference(dictionary))
+ * ```
+ * @param {Dictionary} dictionary
+ * @returns {Function}
+ */
+ function sortByReference(dictionary) {
+ // The sorter function is recursive to account for multiple levels of nesting
+ function sorter(a, b) {
+ const aComesFirst = -1;
+ const bComesFirst = 1;
+
+ // If token a uses a reference and token b doesn't, b might come before a
+ // read on..
+ if (a.original && dictionary.usesReference(a.original.value)) {
+ // Both a and b have references, we need to see if the reference each other
+ if (b.original && dictionary.usesReference(b.original.value)) {
+ const aRefs = dictionary.getReferences(a.original.value);
+ const bRefs = dictionary.getReferences(b.original.value);
+
+ aRefs.forEach(aRef => {
+ // a references b, we want b to come first
+ if (aRef.name === b.name) {
+ return bComesFirst;
+ }
+ });
+
+ bRefs.forEach(bRef => {
+ // ditto but opposite
+ if (bRef.name === a.name) {
+ return aComesFirst;
+ }
+ });
+
+ // both a and b have references and don't reference each other
+ // we go further down the rabbit hole (reference chain)
+ return sorter(aRefs[0], bRefs[0]);
+ // a has a reference and b does not:
+ } else {
+ return bComesFirst;
+ }
+ // a does not have a reference it should come first regardless if b has one
+ } else {
+ return aComesFirst;
+ }
+ }
+
+ return sorter;
+}
+
+module.exports = sortByReference;
\ No newline at end of file
diff --git a/packages/ui/internals/transform/web/webFont.js b/packages/ui/internals/transform/web/webFont.js
new file mode 100644
index 00000000000..808a9e9a160
--- /dev/null
+++ b/packages/ui/internals/transform/web/webFont.js
@@ -0,0 +1,14 @@
+const notDefault = (value, defaultValue) => (value !== defaultValue) ? value : ''
+
+const fontFamily = ({ fontFamily }, { fontFamilies } = {}) => fontFamilies && fontFamilies[fontFamily] ? fontFamilies[fontFamily] : fontFamily
+
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'custom-fontStyle'
+ },
+ transformer: function ({ value: font }, { options }) {
+ // font: font-style font-variant font-weight font-size/line-height font-family;
+ return `${notDefault(font.fontStretch, 'normal')} ${notDefault(font.fontStyle, 'normal')} ${font.fontWeight} ${font.fontSize}/${font.lineHeight} ${fontFamily(font, options)}`.trim()
+ }
+}
diff --git a/packages/ui/internals/transform/web/webGradient.js b/packages/ui/internals/transform/web/webGradient.js
new file mode 100644
index 00000000000..8c4ee2f19f4
--- /dev/null
+++ b/packages/ui/internals/transform/web/webGradient.js
@@ -0,0 +1,19 @@
+const TinyColor = require('@ctrl/tinycolor')
+
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'custom-gradient'
+ },
+ transformer: function ({ value }) {
+ const stopsString = value.stops.map(stop => {
+ return `${new TinyColor.TinyColor(stop.color).toRgbString()} ${stop.position * 100}%`
+ }).join(', ')
+ if (value.gradientType === 'linear') {
+ return `linear-gradient(${value.rotation}deg, ${stopsString})`
+ }
+ if (value.gradientType === 'radial') {
+ return `radial-gradient(${stopsString})`
+ }
+ }
+}
diff --git a/packages/ui/internals/transform/web/webPadding.js b/packages/ui/internals/transform/web/webPadding.js
new file mode 100644
index 00000000000..0aff7bf248d
--- /dev/null
+++ b/packages/ui/internals/transform/web/webPadding.js
@@ -0,0 +1,12 @@
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'custom-spacing'
+ },
+ transformer: ({ value: { top, left, bottom, right } }) => {
+ if ([bottom, left, right].every(v => v === top)) {
+ return `${top}px`
+ }
+ return `${top}px ${right}px ${bottom}px ${left}px`
+ }
+}
diff --git a/packages/ui/internals/transform/web/webRadius.js b/packages/ui/internals/transform/web/webRadius.js
new file mode 100644
index 00000000000..730be6d3bca
--- /dev/null
+++ b/packages/ui/internals/transform/web/webRadius.js
@@ -0,0 +1,12 @@
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'custom-radius'
+ },
+ transformer: function ({ value }) {
+ if ([value.topRight, value.bottomLeft, value.bottomRight].every(v => v === value.topLeft)) {
+ return `${value.topLeft}px`
+ }
+ return `${value.topLeft}px ${value.topRight}px ${value.bottomLeft}px ${value.bottomRight}px`
+ }
+}
diff --git a/packages/ui/internals/transform/web/webShadows.js b/packages/ui/internals/transform/web/webShadows.js
new file mode 100644
index 00000000000..997cddd5cb8
--- /dev/null
+++ b/packages/ui/internals/transform/web/webShadows.js
@@ -0,0 +1,11 @@
+const TinyColor = require('@ctrl/tinycolor')
+
+module.exports = {
+ type: 'value',
+ matcher: function (token) {
+ return token.type === 'custom-shadow' && token.value !== 0
+ },
+ transformer: function ({ value }) {
+ return `${value.shadowType === 'innerShadow' ? 'inset ' : ''}${value.offsetX}px ${value.offsetY}px ${value.radius}px ${value.spread}px ${new TinyColor.TinyColor(value.color).toRgbString()}`
+ }
+}
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 580ccdba98b..5a4d488e2fb 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -8,11 +8,11 @@
"scripts": {
"build:icons": "node --experimental-modules internals/populate-icons.js",
"typecheck_CURRENTLY_IGNORED": "tsc --noEmit",
- "build-tokens": "node internals/tokens/build-tokens.js",
- "copy-tokens": "node internals/tokens/copy-tokens.js",
- "cleanse-css-for-tailwind": "node internals/tokens/cleanse-css-for-tailwind.js",
"generate-demo-tailwind-classes": "node internals/tokens/generate-demo-tailwind-classes.js",
- "generate-styles": "npm run copy-tokens && npm run build-tokens && npm run cleanse-css-for-tailwind && npm run generate-demo-tailwind-classes",
+ "cleanse-css-for-tailwind": "node internals/tokens/cleanse-css-for-tailwind.js",
+ "transform-tokens": "node ./transformTokens.js",
+ "extract-design-tokens": "node internals/tokens/extract-design-tokens.js",
+ "generate-styles": "npm run extract-design-tokens && npm run transform-tokens && npm run cleanse-css-for-tailwind && npm run generate-demo-tailwind-classes",
"storybook-build": "storybook build",
"storybook": "storybook dev -p 6006",
"test": "jest"
@@ -110,6 +110,7 @@
"storybook": "^7.0.5",
"storybook-dark-mode": "^3.0.0",
"style-dictionary": "^3.7.1",
+ "@ctrl/tinycolor": "^3.4.0",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "^5.0.4",
"ts-jest": "^29.1.1",
diff --git a/packages/ui/src/lib/tailwind-demo-classes.ts b/packages/ui/src/lib/tailwind-demo-classes.ts
index e9d0afb240a..bad7b532179 100644
--- a/packages/ui/src/lib/tailwind-demo-classes.ts
+++ b/packages/ui/src/lib/tailwind-demo-classes.ts
@@ -7,8 +7,11 @@ export default {
"bg-surface-100",
"bg-surface-200",
"bg-surface-300",
+ "bg-surface-_contrast-300",
"bg-overlay",
- "bg-overlay-hover"
+ "bg-overlay-hover",
+ "bg-secondary",
+ "bg-muted"
],
"border": [
"border",
@@ -16,14 +19,17 @@ export default {
"border-secondary",
"border-overlay",
"border-control",
- "border-alternative"
+ "border-alternative",
+ "border-strong",
+ "border-stronger"
],
"text": [
"text",
"text-strong",
"text-light",
"text-lighter",
- "text-muted"
+ "text-muted",
+ "text-contrast"
],
"colors": [
"bg-destructive-200",
@@ -43,7 +49,9 @@ export default {
"bg-brand-400",
"bg-brand-500",
"bg-brand-600",
- "bg-brand"
+ "bg-brand",
+ "bg-brand-accent",
+ "bg-secondary"
],
"palletes": [
"bg-black",
diff --git a/packages/ui/tailwind-theming.md b/packages/ui/tailwind-theming.md
index e9dc3ce6242..7ab408845b0 100644
--- a/packages/ui/tailwind-theming.md
+++ b/packages/ui/tailwind-theming.md
@@ -1,83 +1,138 @@
# Tailwind theming
Supabase is migrating to use tailwind classes that use CSS properties.
-
This is to support the concept of theming, so that:
1. It is easy for the team to update the theme without changing 100s of files.
2. We could offer custom or additional themes in future.
-## Classes
-
-The classes are a work in progress but some are now in use and will probably be permanent fixtures.
-
-The following are some of the most used classes.
-
-It is still a work in progress and class names are likely to change.
+## Primitives
-### Text
+We (the Supabase Design team ✨) define primitive color values using Figma Variables.
-Default text
+- `foreground`
+- `background`
+- `border`
+- `brand` (could become primary)
+- `destructive`
+- `warning`
-`text-foreground`
+These values are exported from Figma as a .json file and transformed into tailwind utilities through some scripts under `packages/ui/internals/tokens`.
-Light text
+Primitives work the same way as any other color. They should follow some basic usage patterns such as _foreground_ on text and _background_ on surfaces, but they can also be combined with any tailwind utility to achieve more advanced layouts.
-`text-foreground-light`
+For example, `foreground-light` can also be applied on borders and backgrounds as `border-foreground-light` and `bg-foreground-light`, if needed.
-Lighter text
+Similarly, background and border primitives can be used on other tailwind utilities.
-`text-foreground-lighter`
+```
+border-surface-100
+bg-border-overlay
+text-background-surface-100
+```
----
+## Usage
-### Background
+The following tailwind classes are a combination of tailwind utilities and our primitives. They're under development and are likely to change but most are now in use and will probably be permanent fixtures.
-App background
-(considering changing this to "bg-body")
-`bg`
+### Foreground (Text)
-Panels
+| Value | Usage |
+| ---------------------- | -------------------------------------- |
+| `foreground-{DEFAULT}` | Default text (**DEFAULT** is optional) |
+| `foreground-light` | Light text |
+| `foreground-lighter` | Lighter text |
+| `foreground-muted` | Muted text |
-`bg-surface-100`
+Examples:
-`bg-surface-200`
+```
+text-foreground
+text-foreground-light
+text-foreground-lighter
+text-foreground-muted
+bg-foreground-light
+```
-`bg-surface-300`
+---
-Alernative background (inverted)
-`bg-alternative`
+### Background
-Overlays, Dropdowns, Popovers
+| Value | Usage |
+| -------------------------- | ------------------------------------------------------------ |
+| `{background}-{DEFAULT}` | Main body background (**DEFAULT** is optional) |
+| `{background}-surface-100` | Panels and surfaces on the same level of the main background |
+| `{background}-surface-200` | Surfaces that overlap the main content (ex. drodowns) |
+| `{background}-surface-300` | Surfaces that are stacked above {background}-surface-200 |
+| `{background}-alternative` | Alernative background (inverted) |
+| `{background}-overlay` | Overlays, Dropdowns, Popovers |
+| `{background}-control` | Inputs, Radios, Checkboxes |
-`bg-overlay`
+The `background` part can be omitted when used on the `bg` tailwind utility.
-Inputs, Radios, Checkboxes
+Examples:
-`bg-control`
+```
+bg-surface-100
+bg-overlay
+bg-alternative
+text-background-surface-100
+```
---
### Border
-Default border
-
-`border`
-
-Secondary border
-
-`border-secondary`
-
-Alernative border (inverted)
-`border-alternative`
-
-Overlays, Dropdowns, Popovers
-
-`border-overlay`
-
-Inputs, Radios, Checkboxes
-
-`border-control`
+| Value | Usage |
+| -------------------- | ---------------------------------------- |
+| `border-{DEFAULT}` | Default border (**DEFAULT** is optional) |
+| `border-secondary` | Secondary border |
+| `border-alternative` | Alernative border (inverted) |
+| `border-overlay` | Overlays, Dropdowns, Popovers |
+| `border-control` | Inputs, Radios, Checkboxes |
+| `border-strong` | Hover, Focus |
+| `border-stronger` | Highlighted border |
+
+Examples:
+
+```
+border-overlay
+border-alternative
+text-border-control
+```
+
+### Brand
+
+| Value |
+| --------- |
+| `200` |
+| `300` |
+| `400` |
+| `500` |
+| `DEFAULT` |
+| `600` |
+
+### Destructive
+
+| Value |
+| --------- |
+| `200` |
+| `300` |
+| `400` |
+| `500` |
+| `DEFAULT` |
+| `600` |
+
+### Warning
+
+| Value |
+| --------- |
+| `200` |
+| `300` |
+| `400` |
+| `500` |
+| `DEFAULT` |
+| `600` |
## Storybook
diff --git a/packages/ui/transformTokens.js b/packages/ui/transformTokens.js
new file mode 100644
index 00000000000..972608b862f
--- /dev/null
+++ b/packages/ui/transformTokens.js
@@ -0,0 +1,275 @@
+const glob = require('glob')
+
+const sourceFiles = glob.sync(`tokens/core/**/*.json`)
+const themeFiles = glob.sync(`tokens/themes/**/*.json`)
+
+const StyleDictionary = require('style-dictionary')
+const deepMerge = require('deepmerge')
+const webConfig = require('./internals/transform/web/index.js')
+
+const Color = require('color')
+
+StyleDictionary.registerTransform({
+ name: 'size/px',
+ type: 'value',
+ matcher: (token) => {
+ return (token.unit === 'pixel' || token.type === 'dimension') && token.value !== 0
+ },
+ transformer: (token) => {
+ return `${token.value}px`
+ },
+})
+
+StyleDictionary.registerTransform({
+ name: 'size/percent',
+ type: 'value',
+ matcher: (token) => {
+ return token.unit === 'percent' && token.value !== 0
+ },
+ transformer: (token) => {
+ return `${token.value}%`
+ },
+})
+
+StyleDictionary.registerFilter({
+ name: 'validToken',
+ matcher: function (token) {
+ return [
+ 'dimension',
+ 'string',
+ 'number',
+ 'color',
+ 'custom-spacing',
+ 'custom-gradient',
+ 'custom-fontStyle',
+ 'custom-radius',
+ 'custom-shadow',
+ ].includes(token.type)
+ },
+})
+
+/**
+ * Custom format that generate tailwind color config based on css variables
+ */
+StyleDictionary.registerFormat({
+ name: 'tw/css-variables',
+ formatter({ dictionary }) {
+ // console.log('dictionary', dictionary)
+ return (
+ 'module.exports = ' +
+ `{\n${dictionary.allProperties
+ .map((token) => {
+ const value = formatTailwindValue(token.type, token.value)
+ return `"${token.path.slice(0).join('-')}": {
+ cssVariable: "var(--${token.name})",
+ value: "${value}"
+}`
+ .replace('core-', '') // remove core prefix
+ .replace('default', 'DEFAULT') // replace default with DEFAULT for tailwind config
+ })
+ .join(',\n')}\n}`
+ )
+ },
+})
+
+/**
+ * Custom format that generates tailwind friendly colors so we can add <alpha-value>
+ * in the config later
+ * https://tailwindcss.com/docs/customizing-colors#using-css-variables
+ */
+StyleDictionary.registerTransform({
+ name: 'color/rgb',
+ type: 'value',
+ matcher: (prop) => prop.type === 'color',
+ transformer: (prop) => {
+ if (!prop.original.value) {
+ console.error(`No colorvalue detected for ${prop.name}.`)
+ }
+
+ if (prop.original.value === '#') {
+ console.error(`Only "#" as value for ${prop.name}. Must use a correct format like "#FFF"`)
+ }
+
+ const color = Color(prop?.original?.value)
+
+ if (!color) {
+ console.error('No color')
+ }
+
+ // console.log(color)
+
+ const hsl = Color(prop?.original?.value).hsl()
+ return hsl.string()
+ },
+})
+
+function fileNameCleaner(fileName) {
+ return fileName.split('/').pop().replace('.json', '')
+}
+
+const formatTailwindValue = (tokenType, value) => {
+ let formattedValue
+ switch (tokenType) {
+ case 'color':
+ default:
+ formattedValue = value
+ }
+ return formattedValue
+}
+
+/**
+ * uncomment tailwind types as they become available
+ */
+const supportedTokenTypeList = [
+ // 'spacing',
+ // 'sizing',
+ // 'borderRadius',
+ // 'borderWidth',
+ 'color',
+ // 'opacity',
+ // 'fontFamilies',
+ // 'lineHeights',
+ // 'letterSpacing',
+ // 'paragraphSpacing',
+ // 'fontWeights',
+ // 'fontSizes',
+ // 'textCase',
+ // 'textDecoration',
+]
+
+/**
+ * Returns the files configuration
+ * for generating separated tailwind files.
+ */
+function getConfigTailwindFilesByType(typeList) {
+ console.log('\n')
+ console.log('tailwind typeList', typeList)
+ return typeList.map((typeName) => {
+ return {
+ destination: `tw-extend/${typeName}.js`,
+ format: 'tw/css-variables',
+ filter: {
+ type: typeName,
+ },
+ }
+ })
+}
+
+/**
+ * BUILD SOURCE FILES
+ */
+
+console.log(`\n`)
+
+console.log('Building Core Styles...')
+
+console.log(`\n`)
+
+sourceFiles.map(function (filePath) {
+ console.log(filePath)
+
+ const StyleDictionaryExtended = StyleDictionary.extend({
+ ...deepMerge.all([webConfig]),
+ source: [filePath],
+ platforms: {
+ css: {
+ transformGroup: 'custom/css',
+ buildPath: 'build/css/',
+ files: [
+ {
+ destination: 'source/global.css',
+ format: 'css/variables',
+ filter: 'validToken',
+ options: {
+ showFileHeader: false,
+ },
+ },
+ ],
+ },
+ // 'json-flat': {
+ // transformGroup: 'js',
+ // buildPath: 'build/json/',
+ // files: [
+ // {
+ // destination: 'core-styles.json',
+ // format: 'json/flat',
+ // filter: 'validToken',
+ // },
+ // ],
+ // },
+ },
+ })
+
+ StyleDictionaryExtended.buildAllPlatforms()
+ // console.log('StyleDictionaryExtended', StyleDictionaryExtended)
+ // Check if properties and all are defined
+ if (StyleDictionaryExtended.properties && StyleDictionaryExtended.properties.all) {
+ // Modify and print the CSS with the prefix removed
+ const modifiedCSS =
+ StyleDictionaryExtended.properties.all.reduce((result, prop) => {
+ const modifiedName = prop.path.join('-').replace(/^core-/, '')
+ result += ` --${modifiedName}: ${prop.original.value};\n`
+ return result
+ }, ':root {\n') + '}'
+
+ console.log(modifiedCSS)
+ } else {
+ console.error('Error: Unable to retrieve properties from StyleDictionaryExtended.')
+ }
+})
+
+console.log(`\n`)
+
+console.log(`Building Theme Styles...`)
+
+console.log(`\n`)
+
+themeFiles.map(function (filePath, i) {
+ const fileName = fileNameCleaner(filePath)
+
+ let configTailwindFilesByType = []
+
+ if (i === 0) {
+ // runs on first theme file
+ console.log(`\n`)
+ console.log(`Generating Tailwind Props ✨`)
+ configTailwindFilesByType = getConfigTailwindFilesByType(supportedTokenTypeList)
+ }
+
+ const StyleDictionaryExtended = StyleDictionary.extend({
+ ...deepMerge.all([webConfig]),
+ source: [...sourceFiles, filePath],
+ platforms: {
+ css: {
+ transformGroup: 'custom/css',
+ buildPath: 'build/css/',
+ files: [
+ {
+ destination: `themes/${fileName}.css`,
+ format: 'css/variables',
+ filter: 'validToken',
+ options: {
+ showFileHeader: false,
+ outputReferences: true,
+ selector: `.${fileName}`,
+ },
+ filter: (token) => token.filePath === filePath,
+ },
+ ...configTailwindFilesByType,
+ ],
+ },
+ // 'json-flat': {
+ // transformGroup: 'js',
+ // buildPath: 'build/json/',
+ // files: [
+ // {
+ // destination: `themes/${fileName}-styles.json`,
+ // format: 'json/flat',
+ // filter: 'validToken',
+ // },
+ // ],
+ // },
+ },
+ })
+ StyleDictionaryExtended.buildAllPlatforms()
+})