Skip to content

Commit 3b6f068

Browse files
authored
fix: check design theme type (#135)
1 parent 629aa34 commit 3b6f068

2 files changed

Lines changed: 23 additions & 6 deletions

File tree

packages/core/src/core/style.module.less

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@ codeblitz-root {
1616
flex-direction: column;
1717
justify-content: center;
1818
align-items: center;
19-
color: #4D4D4D;
20-
background-color: #FFF;
19+
color: var(--codeblitz-landing-foreground);
20+
background-color: var(--codeblitz-landing-background);
2121
}
2222

23-
:global(.codeblitz-dark) .landing {
24-
color: #D7DBDE;
25-
background-color: #202224;
23+
:root {
24+
--codeblitz-landing-dark-foreground: #D7DBDE;
25+
--codeblitz-landing-dark-background: #202224;
26+
27+
--codeblitz-landing-foreground: #4D4D4D;
28+
--codeblitz-landing-background: #FFF;
2629
}
2730

2831
:global(.codeblitz-dark) {
29-
background-color: #202224;
32+
background-color: var(--codeblitz-landing-dark-background);
33+
34+
& .landing {
35+
color: var(--codeblitz-landing-dark-foreground);
36+
background-color: var(--codeblitz-landing-dark-background);
37+
}
3038
}
3139

3240
.loading {

packages/sumi-core/src/common/theme.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { IExtensionBasicMetadata } from '@codeblitzjs/ide-common';
22
import { BuiltinTheme, getThemeId, getThemeType, IThemeContribution } from '@opensumi/ide-theme';
33

4+
const builtinTheme = {
5+
"opensumi-design-dark-theme": "vs-dark",
6+
"opensumi-design-light-theme": "vs",
7+
} as Record<string, BuiltinTheme>
8+
49
export const getThemeTypeByPreferenceThemeId = (
510
themeId: string,
611
extensionMetadata: IExtensionBasicMetadata[] | undefined,
@@ -18,5 +23,9 @@ export const getThemeTypeByPreferenceThemeId = (
1823
}
1924
}
2025
}
26+
if (builtinTheme[themeId]) {
27+
uiTheme = builtinTheme[themeId];
28+
}
29+
2130
return getThemeType(uiTheme || 'vs-dark');
2231
};

0 commit comments

Comments
 (0)