Skip to content

Commit

Permalink
fix: Style dictionary helpers folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
CCAyl authored Oct 18, 2023
2 parents 46fea20 + 26b64cc commit b786fb1
Show file tree
Hide file tree
Showing 60 changed files with 396 additions and 350 deletions.
28 changes: 6 additions & 22 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const StyleDictionary = require("style-dictionary");
require("./src/helpers/custom");
require("./src/helpers/style-dictionary");

const getStyleDictionaryConfig = (theme) => {
const isCore = theme.includes("core");
Expand All @@ -21,9 +21,7 @@ const getStyleDictionaryConfig = (theme) => {
filter: "custom/filter/typography",
},
{
destination: isCore
? `${theme}-colors.scss`
: `themes/${theme}.scss`,
destination: isCore ? `${theme}-colors.scss` : `themes/${theme}.scss`,
format: "scss/variables",
filter: {
type: "color",
Expand Down Expand Up @@ -72,9 +70,7 @@ const getStyleDictionaryConfig = (theme) => {
},
{
format: "custom/format/typescript-color-declarations",
destination: isCore
? `${theme}-colors.d.ts`
: `themes/${theme}.d.ts`,
destination: isCore ? `${theme}-colors.d.ts` : `themes/${theme}.d.ts`,
filter: "custom/filter/themeTokens",
},
],
Expand Down Expand Up @@ -120,9 +116,7 @@ const getStyleDictionaryConfig = (theme) => {
},
{
format: "custom/format/typescript-color-declarations",
destination: isCore
? `${theme}-colors.d.ts`
: `themes/${theme}.d.ts`,
destination: isCore ? `${theme}-colors.d.ts` : `themes/${theme}.d.ts`,
filter: "custom/filter/themeTokens",
},
],
Expand All @@ -140,9 +134,7 @@ const getStyleDictionaryConfig = (theme) => {
},
{
format: "custom/format/typescript-color-declarations-documentation",
destination: isCore
? `${theme}-colors.d.ts`
: `themes/${theme}.d.ts`,
destination: isCore ? `${theme}-colors.d.ts` : `themes/${theme}.d.ts`,
filter: {
type: "color",
},
Expand All @@ -155,15 +147,7 @@ const getStyleDictionaryConfig = (theme) => {

// Add themes to the array to create theme-specific files under themes folder
// "core" theme will build files outside of the themes folder
const themes = [
"primitives",
"core-light",
"core-dark",
"light",
"lightDS3",
"dark",
"emerson",
];
const themes = ["primitives", "core-light", "core-dark", "light", "lightDS3", "dark", "emerson"];

themes.map((theme) => {
StyleDictionary.extend(getStyleDictionaryConfig(theme)).buildAllPlatforms();
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/core-dark-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/core-dark-colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {green : {100:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/core-light-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/core-light-colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {green : {100:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/dark.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/dark.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/emerson.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/emerson.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/light.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/light.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/lightDS3.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/documentation/themes/lightDS3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {text : {emphasis:{
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/borders.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const radiusBase : number;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/borders.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/core-dark-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100 : string,200 : string,300 : string,400 : string,500 : string,600 : string,700 : string,800 : string};
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/core-dark-colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {green : {100 : "#0C291E",200 : "#0F3326",300 : "#13402F",400 : "#256E53",500 : "#288563",600 : "#42AD86",700 : "#86D6B9",800 : "#DBFFF1"},
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/core-light-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100 : string,200 : string,300 : string,400 : string,500 : string,600 : string,700 : string,800 : string};
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/core-light-colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {green : {100 : "#FAFFFC",200 : "#EBF2EF",300 : "#D1E0D9",400 : "#B6CFC2",500 : "#86B09B",600 : "#307553",700 : "#275E43",800 : "#244C38"},
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/themes/dark.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const theme: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/themes/dark.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tokens/native/themes/emerson.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const theme: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/themes/emerson.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tokens/native/themes/light.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const theme: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/themes/light.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tokens/native/themes/lightDS3.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const theme: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/themes/lightDS3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tokens/native/typography.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const letterSpacingBase : number;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/native/typography.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/borders.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$radiusBase: 8px;
$radiusCircle: 50%;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/core-dark-colors.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$green100: #0C291E;
$green200: #0F3326;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/core-light-colors.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$green100: #FAFFFC;
$green200: #EBF2EF;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/themes/dark.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$textEmphasis: #E8E9EA;
$textBody: #BCBDBF;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/themes/emerson.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$textEmphasis: #36485C;
$textBody: #475A70;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/themes/light.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$textEmphasis: #2E3A47;
$textBody: #36485C;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/themes/lightDS3.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$textEmphasis: #36485C;
$textBody: #475A70;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/scss/typography.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// Do not edit directly
// Generated on Tue, 17 Oct 2023 13:39:15 GMT
// Generated on Tue, 17 Oct 2023 16:02:33 GMT

$letterSpacingBase: 0;
$paragraphSpacingBase: 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/ts/borders.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const radiusBase : string;
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/ts/borders.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/ts/core-dark-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100 : string,200 : string,300 : string,400 : string,500 : string,600 : string,700 : string,800 : string};
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/ts/core-dark-colors.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

module.exports = {green : {100 : "#0C291E",200 : "#0F3326",300 : "#13402F",400 : "#256E53",500 : "#288563",600 : "#42AD86",700 : "#86D6B9",800 : "#DBFFF1"},
Expand Down
2 changes: 1 addition & 1 deletion dist/tokens/ts/core-light-colors.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Do not edit directly
* Generated on Tue, 17 Oct 2023 13:39:15 GMT
* Generated on Tue, 17 Oct 2023 16:02:33 GMT
*/

export const green : {100 : string,200 : string,300 : string,400 : string,500 : string,600 : string,700 : string,800 : string};
Expand Down
Loading

0 comments on commit b786fb1

Please sign in to comment.