Skip to content

Commit 9bb2fc9

Browse files
committed
style: add dark theme color scheme
1 parent ccd2a30 commit 9bb2fc9

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

src/browser/pages/error.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111

1212
.error-display > .body {
13-
color: #444;
13+
color: light-dark(#444, #ccc);
1414
font-size: 1.2rem;
1515
}
1616

src/browser/pages/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
http-equiv="Content-Security-Policy"
1111
content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
1212
/>
13-
13+
<meta name="color-scheme" content="light dark" />
1414
<title>{{ERROR_TITLE}} - code-server</title>
1515
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
1616
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />

src/browser/pages/global.css

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
:root {
2+
color-scheme: light dark;
3+
}
4+
15
html,
26
body,
37
#root {
@@ -6,8 +10,8 @@ body,
610
}
711

812
body {
9-
background: rgb(244, 247, 252);
10-
color: #111;
13+
background: light-dark(rgb(244, 247, 252), #111);
14+
color: light-dark(#111, #ddd);
1115
margin: 0;
1216
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
1317
"Segoe UI Emoji", "Segoe UI Symbol";
@@ -22,11 +26,11 @@ button {
2226
}
2327

2428
.-button {
25-
background-color: rgb(87, 114, 245);
29+
background-color: light-dark(rgb(87, 114, 245), rgb(50, 85, 250));
2630
border-radius: 5px;
2731
border: none;
2832
box-sizing: border-box;
29-
color: white;
33+
color: light-dark(white, #ddd);
3034
cursor: pointer;
3135
padding: 18px 20px;
3236
text-decoration: none;
@@ -44,7 +48,7 @@ button {
4448
}
4549

4650
.card-box {
47-
background-color: rgb(250, 253, 258);
51+
background-color: light-dark(rgb(250, 253, 258), #000);
4852
border-radius: 5px;
4953
box-shadow:
5054
rgba(60, 66, 87, 0.117647) 0px 7px 14px 0px,
@@ -54,8 +58,8 @@ button {
5458
}
5559

5660
.card-box > .header {
57-
border-bottom: 1px solid #ddd;
58-
color: #444;
61+
border-bottom: 1px solid light-dark(#ddd, #222);
62+
color: light-dark(#444, #ccc);
5963
padding: 30px;
6064
}
6165

@@ -65,7 +69,7 @@ button {
6569
}
6670

6771
.card-box > .header > .sub {
68-
color: #555;
72+
color: light-dark(#555, #aaa);
6973
margin-top: 10px;
7074
}
7175

src/browser/pages/login.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ body {
2929
}
3030

3131
.login-form > .field > .password {
32-
background-color: rgb(244, 247, 252);
32+
background-color: light-dark(rgb(244, 247, 252), #222);
3333
border-radius: 5px;
34-
border: 1px solid #ddd;
34+
border: 1px solid light-dark(#ddd, #333);
3535
box-sizing: border-box;
36-
color: black;
3736
flex: 1;
3837
padding: 16px;
3938
}

src/browser/pages/login.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
http-equiv="Content-Security-Policy"
1111
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
1212
/>
13+
<meta name="color-scheme" content="light dark" />
1314
<title>{{I18N_LOGIN_TITLE}}</title>
1415
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
1516
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />

0 commit comments

Comments
 (0)