Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchen committed Feb 16, 2025
1 parent 26f1447 commit 956e071
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ const vitepressConfig = defineConfig({
markdown: {
lineNumbers: true,
theme: {
light: await themeService.getTheme('JetBrains Rider New UI theme - Light'),
// light: await themeService.getTheme('Eva Light'),
// dark: await themeService.getTheme('Eva Dark'),
light: await themeService.getTheme('JetBrains Rider New UI theme - Light'),
dark: await themeService.getTheme('JetBrains Rider New UI theme - Dark'),
},
codeTransformers: [transformerTwoslash()],
Expand Down
15 changes: 13 additions & 2 deletions docs/services/ThemeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ class ThemeService implements IThemeService {
async register(theme: TextmateTheme): Promise<void> {
if (this.isThemeRegistered(theme.name as ThemeName)) return;
if (theme.name.includes('Eva')) {
const foo = theme.tokenColors.filter(x => x.scope.startsWith('comment'))[0];
foo.settings.fontStyle = '';
theme.tokenColors.push({
scope: 'comment',
settings: {
foreground: theme.name.includes('Dark') ? '#676e59' : '#a9a9aa',
fontStyle: '',
},
});
}
await this.innerThemeService.loadTheme(theme);
}
Expand Down Expand Up @@ -86,6 +91,12 @@ class ThemeService implements IThemeService {
const [themeName, info] = x;
const theme = await this.fetchThemeObject(info);
if (!theme.name) theme.name = themeName; // in case the theme does not have a name to indentify itself
if (themeName === 'JetBrains Rider New UI theme - Dark') {
theme.tokenColors.push({
scope: 'keyword.operator',
settings: { foreground: '#6C95EB' },
});
}
await this.register(theme);
console.log(`Textmate theme: \`${themeName}\` has loaded.`);
}),
Expand Down

0 comments on commit 956e071

Please sign in to comment.