Fix typescript indent size
This commit is contained in:
+74
-74
@@ -7,80 +7,80 @@ import { colors, fontFamilies, fontSizes, fontWeights } from "./tokens";
|
||||
|
||||
// Organize theme tokens
|
||||
function themeTokens(theme: Theme) {
|
||||
return {
|
||||
meta: {
|
||||
themeName: theme.name,
|
||||
},
|
||||
text: theme.textColor,
|
||||
icon: theme.iconColor,
|
||||
background: theme.backgroundColor,
|
||||
border: theme.borderColor,
|
||||
editor: theme.editor,
|
||||
syntax: {
|
||||
primary: {
|
||||
value: theme.syntax.primary.color.value,
|
||||
type: "color",
|
||||
},
|
||||
comment: {
|
||||
value: theme.syntax.comment.color.value,
|
||||
type: "color",
|
||||
},
|
||||
keyword: {
|
||||
value: theme.syntax.keyword.color.value,
|
||||
type: "color",
|
||||
},
|
||||
function: {
|
||||
value: theme.syntax.function.color.value,
|
||||
type: "color",
|
||||
},
|
||||
type: {
|
||||
value: theme.syntax.type.color.value,
|
||||
type: "color",
|
||||
},
|
||||
variant: {
|
||||
value: theme.syntax.variant.color.value,
|
||||
type: "color",
|
||||
},
|
||||
property: {
|
||||
value: theme.syntax.property.color.value,
|
||||
type: "color",
|
||||
},
|
||||
enum: {
|
||||
value: theme.syntax.enum.color.value,
|
||||
type: "color",
|
||||
},
|
||||
operator: {
|
||||
value: theme.syntax.operator.color.value,
|
||||
type: "color",
|
||||
},
|
||||
string: {
|
||||
value: theme.syntax.string.color.value,
|
||||
type: "color",
|
||||
},
|
||||
number: {
|
||||
value: theme.syntax.number.color.value,
|
||||
type: "color",
|
||||
},
|
||||
boolean: {
|
||||
value: theme.syntax.boolean.color.value,
|
||||
type: "color",
|
||||
},
|
||||
},
|
||||
player: theme.player,
|
||||
shadowAlpha: theme.shadowAlpha,
|
||||
};
|
||||
return {
|
||||
meta: {
|
||||
themeName: theme.name,
|
||||
},
|
||||
text: theme.textColor,
|
||||
icon: theme.iconColor,
|
||||
background: theme.backgroundColor,
|
||||
border: theme.borderColor,
|
||||
editor: theme.editor,
|
||||
syntax: {
|
||||
primary: {
|
||||
value: theme.syntax.primary.color.value,
|
||||
type: "color",
|
||||
},
|
||||
comment: {
|
||||
value: theme.syntax.comment.color.value,
|
||||
type: "color",
|
||||
},
|
||||
keyword: {
|
||||
value: theme.syntax.keyword.color.value,
|
||||
type: "color",
|
||||
},
|
||||
function: {
|
||||
value: theme.syntax.function.color.value,
|
||||
type: "color",
|
||||
},
|
||||
type: {
|
||||
value: theme.syntax.type.color.value,
|
||||
type: "color",
|
||||
},
|
||||
variant: {
|
||||
value: theme.syntax.variant.color.value,
|
||||
type: "color",
|
||||
},
|
||||
property: {
|
||||
value: theme.syntax.property.color.value,
|
||||
type: "color",
|
||||
},
|
||||
enum: {
|
||||
value: theme.syntax.enum.color.value,
|
||||
type: "color",
|
||||
},
|
||||
operator: {
|
||||
value: theme.syntax.operator.color.value,
|
||||
type: "color",
|
||||
},
|
||||
string: {
|
||||
value: theme.syntax.string.color.value,
|
||||
type: "color",
|
||||
},
|
||||
number: {
|
||||
value: theme.syntax.number.color.value,
|
||||
type: "color",
|
||||
},
|
||||
boolean: {
|
||||
value: theme.syntax.boolean.color.value,
|
||||
type: "color",
|
||||
},
|
||||
},
|
||||
player: theme.player,
|
||||
shadowAlpha: theme.shadowAlpha,
|
||||
};
|
||||
}
|
||||
|
||||
// Organize core tokens
|
||||
const coreTokens = {
|
||||
color: {
|
||||
...colors,
|
||||
},
|
||||
text: {
|
||||
family: fontFamilies,
|
||||
weight: fontWeights,
|
||||
},
|
||||
size: fontSizes,
|
||||
color: {
|
||||
...colors,
|
||||
},
|
||||
text: {
|
||||
family: fontFamilies,
|
||||
weight: fontWeights,
|
||||
},
|
||||
size: fontSizes,
|
||||
};
|
||||
|
||||
const combinedTokens: any = {};
|
||||
@@ -98,10 +98,10 @@ combinedTokens.core = coreTokens;
|
||||
// We write `${theme}.json` as a separate file for the design team's convenience, but it isn't consumed by Figma Tokens directly.
|
||||
let themes = [dark, light];
|
||||
themes.forEach((theme) => {
|
||||
const themePath = `${distPath}/${theme.name}.json`
|
||||
fs.writeFileSync(themePath, JSON.stringify(themeTokens(theme), null, 2));
|
||||
console.log(`- ${themePath} created`);
|
||||
combinedTokens[theme.name] = themeTokens(theme);
|
||||
const themePath = `${distPath}/${theme.name}.json`
|
||||
fs.writeFileSync(themePath, JSON.stringify(themeTokens(theme), null, 2));
|
||||
console.log(`- ${themePath} created`);
|
||||
combinedTokens[theme.name] = themeTokens(theme);
|
||||
});
|
||||
|
||||
// Write combined tokens to `tokens.json`. This file is consumed by the Figma Tokens plugin to keep our designs consistent with the app.
|
||||
|
||||
Reference in New Issue
Block a user