diff hg-web/src/base.css @ 193:9f4429c49733 hg-web

[HgWeb] Making progress....
author MrJuneJune <me@mrjunejune.com>
date Sun, 25 Jan 2026 20:04:55 -0800
parents 2301aeb7503b
children
line wrap: on
line diff
--- a/hg-web/src/base.css	Sat Jan 24 21:52:14 2026 -0800
+++ b/hg-web/src/base.css	Sun Jan 25 20:04:55 2026 -0800
@@ -1,123 +1,169 @@
-/* --- Colors  ---*/
+/* Reset CSS: https://meyerweb.com/eric/tools/css/reset/ */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed, 
+figure, figcaption, footer, header, hgroup, 
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+	margin: 0;
+	padding: 0;
+	border: 0;
+	font-size: 100%;
+	font: inherit;
+	vertical-align: baseline;
+}
+
+/* ===========================================
+   Base CSS - Color Variables and Basic Setup
+   =========================================== */
+
+/* Light mode (default) */
 :root {
   --bg: #ffffff;
-  --fg: #1a1a1a;
-  --border: #e0e0e0;
-  --hover: #f5f5f5;
-  --accent: #0066cc;
-  --accent-hover: #0052a3;
-  --secondary: #6c757d;
-  --success: #28a745;
-  --warning: #ffc107;
-  --danger: #dc3545;
-  --code-bg: #f6f8fa;
-  --link: #0066cc;
-  --link-hover: #0052a3;
+  --bg-subtle: #f6f8fa;
+  --bg-code: #f6f8fa;
+  --border: #d0d7de;
+  --accent: #0969da;
+  --text-primary: #1f2328;
+  --text-secondary: #656d76;
+  --hover: #f3f4f6;
+  --success: #1a7f37;
+  --danger: #cf222e;
+  --danger-bg: #ffebe9;
+  --danger-border: #ffdce0;
+  --overlay: rgba(0, 0, 0, 0.5);
+
+  /* Graph colors - light mode */
+  --graph-1: #495057;
+  --graph-2: #1971c2;
+  --graph-3: #099268;
+  --graph-4: #e67700;
+  --graph-5: #7048e8;
+  --graph-6: #c92a2a;
+  --graph-7: #c2255c;
+  --graph-node-border: #ffffff;
 }
 
-.dark {
+/* Dark mode - applied when html has .dark class */
+:root.dark {
   --bg: #0d1117;
-  --fg: #c9d1d9;
+  --bg-subtle: #161b22;
+  --bg-code: #161b22;
   --border: #30363d;
-  --hover: #161b22;
   --accent: #58a6ff;
-  --accent-hover: #79c0ff;
-  --secondary: #8b949e;
-  --success: #3fb950;
-  --warning: #d29922;
+  --text-primary: #e6edf3;
+  --text-secondary: #8b949e;
+  --hover: #1c2128;
+  --success: #238636;
   --danger: #f85149;
-  --code-bg: #161b22;
-  --link: #58a6ff;
-  --link-hover: #79c0ff;
+  --danger-bg: #f8514926;
+  --danger-border: #f8514966;
+  --overlay: rgba(0, 0, 0, 0.7);
+
+  /* Graph colors - dark mode */
+  --graph-1: #868e96;
+  --graph-2: #4dabf7;
+  --graph-3: #63e6be;
+  --graph-4: #ffbc42;
+  --graph-5: #b197fc;
+  --graph-6: #ff8787;
+  --graph-7: #f06595;
+  --graph-node-border: #1a1a1a;
 }
 
+/* System preference fallback (when no explicit class is set) */
 @media (prefers-color-scheme: dark) {
-  :root:not(.light-mode) {
+  :root:not(.light) {
     --bg: #0d1117;
-    --fg: #c9d1d9;
+    --bg-subtle: #161b22;
+    --bg-code: #161b22;
     --border: #30363d;
-    --hover: #161b22;
     --accent: #58a6ff;
-    --accent-hover: #79c0ff;
-    --secondary: #8b949e;
-    --success: #3fb950;
-    --warning: #d29922;
+    --text-primary: #e6edf3;
+    --text-secondary: #8b949e;
+    --hover: #1c2128;
+    --success: #238636;
     --danger: #f85149;
-    --code-bg: #161b22;
-    --link: #58a6ff;
-    --link-hover: #79c0ff;
+    --danger-bg: #f8514926;
+    --danger-border: #f8514966;
+    --overlay: rgba(0, 0, 0, 0.7);
+
+    --graph-1: #868e96;
+    --graph-2: #4dabf7;
+    --graph-3: #63e6be;
+    --graph-4: #ffbc42;
+    --graph-5: #b197fc;
+    --graph-6: #ff8787;
+    --graph-7: #f06595;
+    --graph-node-border: #1a1a1a;
   }
 }
 
-/* --- Reset and Base Styles --- */
+/* Fonts */
+@font-face {
+  font-family: "Roboto";
+  src: url("/public/fonts/Roboto-Regular.ttf");
+}
+@font-face {
+  font-family: "Roboto Light";
+  src: url("/public/fonts/Roboto-Thin.ttf");
+}
+@font-face {
+  font-family: "More Thin";
+  src: url("/public/fonts/more-sugar.thin.otf");
+}
+@font-face {
+  font-family: "More";
+  src: url("/public/fonts/more-sugar.regular.otf");
+}
+
+button {
+  font-family: "More Thin", sans-serif;
+}
+
+/* Reset and Base */
 * {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
 }
 
-html {
-  background: var(--bg);
-  color: var(--fg);
-}
-
-body {
-  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
-  line-height: 1.6;
+html, body {
   background: var(--bg);
-  color: var(--fg);
-  font-size: 16px;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-}
-
-main {
-  max-width: 1200px;
-  margin: 0 auto;
-  padding: 2rem;
+  color: var(--text-primary);
+  font-family: "More Thin", sans-serif;
+  line-height: 1.6;
+  transition: background 0.2s, color 0.2s;
 }
 
 a {
-  color: var(--link);
+  color: var(--accent);
   text-decoration: none;
 }
 
 a:hover {
-  color: var(--link-hover);
   text-decoration: underline;
 }
 
-h1, h2, h3, h4, h5, h6 {
-  margin-bottom: 1rem;
-  font-weight: 600;
-  line-height: 1.25;
-}
-
-h1 { font-size: 2rem; }
-h2 { font-size: 1.75rem; }
-h3 { font-size: 1.5rem; }
-h4 { font-size: 1.25rem; }
-h5 { font-size: 1.1rem; }
-h6 { font-size: 1rem; }
-
-p {
-  margin-bottom: 1rem;
-}
-
 code {
-  background: var(--code-bg);
+  background: var(--bg-code);
   padding: 0.2em 0.4em;
   border-radius: 3px;
-  font-family: 'Monaco', 'Courier New', monospace;
   font-size: 0.9em;
 }
 
 pre {
-  background: var(--code-bg);
+  background: var(--bg-code);
   padding: 1rem;
   border-radius: 6px;
   overflow-x: auto;
-  margin-bottom: 1rem;
 }
 
 pre code {
@@ -125,17 +171,18 @@
   padding: 0;
 }
 
-/* Mobile responsive */
-@media (max-width: 768px) {
-  body {
-    font-size: 14px;
-  }
+/* Icon invert for dark mode */
+:root.dark .icon-invert {
+  filter: invert(0.8);
+}
 
-  main {
-    padding: 1rem;
-  }
+:root.light .icon-invert,
+:root:not(.dark):not(.light) .icon-invert {
+  filter: none;
+}
 
-  h1 { font-size: 1.75rem; }
-  h2 { font-size: 1.5rem; }
-  h3 { font-size: 1.25rem; }
+@media (prefers-color-scheme: dark) {
+  :root:not(.light) .icon-invert {
+    filter: invert(0.8);
+  }
 }