Skip to content

Commit

Permalink
website(theme): Support tags.standard(tags.tagName) in Theme Editor. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 10, 2022
1 parent cbb7c7a commit af0e3c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions www/src/pages/theme/editor/index.tsx
Expand Up @@ -63,6 +63,7 @@ export type Style = Partial<
propertyNameSpecial: string;
classNameConstant: string;
stringSpecial: string;
tagNameStandard: string;
};

export function ThemeEditor() {
Expand Down Expand Up @@ -99,6 +100,7 @@ export function ThemeEditor() {
getStyle(styles.typeDefinition, { tag: t.definition(t.typeName) }),
getStyle(styles.typeStandard, { tag: t.standard(t.typeName) }),
getStyle(styles.typeName, { tag: t.typeName }),
getStyle(styles.tagNameStandard, { tag: t.standard(t.tagName) }),
getStyle(styles.tagName, { tag: t.tagName }),
getStyle(styles.variableName, { tag: t.variableName }),
getStyle(styles.variableNameDefinition, { tag: t.definition(t.variableName) }),
Expand Down
2 changes: 2 additions & 0 deletions www/src/pages/theme/editor/themeCode.ts
Expand Up @@ -11,6 +11,7 @@ export const defalutStyle: Style = {
typeName: '#194a7b',
typeStandard: '',
tagName: '#008a02',
tagNameStandard: '',
variableName: '#1a00db',
variableNameDefinition: '',
variableNameFunction: '',
Expand Down Expand Up @@ -106,6 +107,7 @@ export const themeCode = (styles: Partial<ThmeCodeStyle> = {}) => {
if (styles.typeName) data.push(`{ tag: t.typeName, color: '${styles.typeName}' },`);
if (styles.typeStandard) data.push(`{ tag: t.standard(t.typeName), color: '${styles.typeName}' },`);
if (styles.tagName) data.push(`{ tag: t.tagName, color: '${styles.tagName}' },`);
if (styles.tagNameStandard) data.push(`{ tag: t.standard(t.tagName), color: '${styles.tagNameStandard}' },`);
if (styles.variableName) data.push(`{ tag: t.variableName, color: '${styles.variableName}' },`);
if (styles.variableNameDefinition)
data.push(`{ tag: t.definition(t.variableName), color: '${styles.variableNameDefinition}' },`);
Expand Down

0 comments on commit af0e3c1

Please sign in to comment.