Skip to content

Commit

Permalink
style: add dark theme color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
qupig committed Dec 14, 2024
1 parent ccd2a30 commit 9bb2fc9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/browser/pages/error.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}

.error-display > .body {
color: #444;
color: light-dark(#444, #ccc);
font-size: 1.2rem;
}

Expand Down
2 changes: 1 addition & 1 deletion src/browser/pages/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
http-equiv="Content-Security-Policy"
content="style-src 'self'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
/>

<meta name="color-scheme" content="light dark" />
<title>{{ERROR_TITLE}} - code-server</title>
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
Expand Down
20 changes: 12 additions & 8 deletions src/browser/pages/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
color-scheme: light dark;
}

html,
body,
#root {
Expand All @@ -6,8 +10,8 @@ body,
}

body {
background: rgb(244, 247, 252);
color: #111;
background: light-dark(rgb(244, 247, 252), #111);
color: light-dark(#111, #ddd);
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol";
Expand All @@ -22,11 +26,11 @@ button {
}

.-button {
background-color: rgb(87, 114, 245);
background-color: light-dark(rgb(87, 114, 245), rgb(50, 85, 250));
border-radius: 5px;
border: none;
box-sizing: border-box;
color: white;
color: light-dark(white, #ddd);
cursor: pointer;
padding: 18px 20px;
text-decoration: none;
Expand All @@ -44,7 +48,7 @@ button {
}

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

.card-box > .header {
border-bottom: 1px solid #ddd;
color: #444;
border-bottom: 1px solid light-dark(#ddd, #222);
color: light-dark(#444, #ccc);
padding: 30px;
}

Expand All @@ -65,7 +69,7 @@ button {
}

.card-box > .header > .sub {
color: #555;
color: light-dark(#555, #aaa);
margin-top: 10px;
}

Expand Down
5 changes: 2 additions & 3 deletions src/browser/pages/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ body {
}

.login-form > .field > .password {
background-color: rgb(244, 247, 252);
background-color: light-dark(rgb(244, 247, 252), #222);
border-radius: 5px;
border: 1px solid #ddd;
border: 1px solid light-dark(#ddd, #333);
box-sizing: border-box;
color: black;
flex: 1;
padding: 16px;
}
Expand Down
1 change: 1 addition & 0 deletions src/browser/pages/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
http-equiv="Content-Security-Policy"
content="style-src 'self'; script-src 'self' 'unsafe-inline'; manifest-src 'self'; img-src 'self' data:; font-src 'self' data:;"
/>
<meta name="color-scheme" content="light dark" />
<title>{{I18N_LOGIN_TITLE}}</title>
<link rel="icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon-dark-support.svg" />
<link rel="alternate icon" href="{{CS_STATIC_BASE}}/src/browser/media/favicon.ico" />
Expand Down

0 comments on commit 9bb2fc9

Please sign in to comment.