Skip to content

Commit 4f67899

Browse files
committed
Inherit theme color for brief loading screen
1 parent 9a3969e commit 4f67899

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

packages/vscode/src/fill/storageDatabase.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ class StorageDatabase implements workspaceStorage.IStorageDatabase {
5252

5353
public updateItems(request: workspaceStorage.IUpdateRequest): Promise<void> {
5454
if (request.insert) {
55-
request.insert.forEach((value, key) => this.items.set(key, value));
55+
request.insert.forEach((value, key) => {
56+
if (key === "colorThemeData") {
57+
localStorage.setItem("colorThemeData", value);
58+
}
59+
60+
this.items.set(key, value);
61+
});
5662
}
5763

5864
if (request.delete) {

packages/web/src/index.html

+28-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta name="viewport" content="width=device-width, initial-scale=1">
5-
<title>VS Code</title>
6-
</head>
7-
<body>
8-
</body>
9-
</html>
3+
4+
<head>
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>code-server</title>
7+
</head>
8+
9+
<body style="background: rgb(30, 30, 30);">
10+
<script>
11+
(() => {
12+
const rawColorTheme = localStorage.getItem("colorThemeData");
13+
if (!rawColorTheme) {
14+
return;
15+
}
16+
const colorTheme = JSON.parse(rawColorTheme);
17+
const colorMap = colorTheme.colorMap;
18+
if (!colorMap) {
19+
return;
20+
}
21+
const bg = colorMap["editor.background"];
22+
if (!bg) {
23+
return;
24+
}
25+
document.body.style.background = bg;
26+
})();
27+
</script>
28+
</body>
29+
30+
</html>

0 commit comments

Comments
 (0)