summaryrefslogtreecommitdiffstats
path: root/cgit.css
diff options
context:
space:
mode:
authorkj_sh6042026-05-05 01:43:49 -0400
committerkj_sh6042026-05-05 01:43:49 -0400
commit088052e379713ce7194d9dbb6285277806495013 (patch)
treed5d321acb42a400c1c97297b150bf48f7bd84b8e /cgit.css
parent73b03cb969c28aafd0c4a8cdedea630c4c5c9085 (diff)
fix: dark mode with syntax highlighting
Diffstat (limited to 'cgit.css')
-rw-r--r--cgit.css45
1 files changed, 45 insertions, 0 deletions
diff --git a/cgit.css b/cgit.css
index 7101b0c..fe91909 100644
--- a/cgit.css
+++ b/cgit.css
@@ -1227,3 +1227,48 @@ div#cgit table.blob .kwc {
div#cgit table.blob .num {
color: var(--links);
}
+
+/* fix syntax hightlighting and rendered markup colors in dark mode */
+@media (prefers-color-scheme: dark) {
+ div#cgit table.blob:has(.highlight),
+ div#cgit div.content:has(#summary) {
+ color-scheme: light;
+ --background-body: #f5f5f5;
+ --background: #eaeaed;
+ --background-alt: #f0f0f3;
+ --selection: #c8c8cc;
+ --text-main: #2a2a2e;
+ --text-bright: #111114;
+ --text-muted: #5a5d66;
+ --links: #2F68D0;
+ --focus: #5a5d66ab;
+ --border: #c8c8cc;
+ --code: #2a2a2e;
+ --button-base: #d4d4d8;
+ --button-hover: #a8a8ae;
+ --form-placeholder: #7a7d86;
+ --variable: #5a6654;
+ --highlight: #e0ddd8;
+ --accent-add: green;
+ --accent-del: red;
+ --accent-upd: #2d68d0;
+ --bg-add: #cfc;
+ --bg-add-strong: #aca;
+ --bg-del: #fcc;
+ --bg-del-strong: #caa;
+ --graph-add: #5c5;
+ --graph-del: #c55;
+ --bg-change: #f0f0f3;
+ --bg-change-strong: #eaeaed;
+ --bg-hunk: #c8c8cc;
+ --tab-active-bg: #e6e8ee;
+ --tab-active-border: #5f6f91;
+ --badge-branch-bg: #e0ddd8;
+ --badge-tag-bg: #d4d4d8;
+ --badge-remote-bg: #c8c8cc;
+ --badge-alert-bg: #d4d4d8;
+ --badge-border: #5a5d66;
+ background-color: var(--background-body);
+ color: var(--text-main);
+ }
+}