From 95ab7223b938021c9b1bbd812fdfa1e3d8943735 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Fri, 30 Oct 2026 21:12:18 +0100 Subject: [PATCH] Restyle the web UI as a dark monospace console Phosphor green on black, square corners, outlined buttons, uppercase headings. Checkboxes in front of their label become switches (small ticks inside tables) instead of stacking above the text. Fieldsets no longer grow wider than the page; wide tables scroll inside their panel. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F --- pkgs/router-webui/static/style.css | 128 +++++++++++++++++++---------- 1 file changed, 86 insertions(+), 42 deletions(-) diff --git a/pkgs/router-webui/static/style.css b/pkgs/router-webui/static/style.css index ab3d3cb..29475cb 100644 --- a/pkgs/router-webui/static/style.css +++ b/pkgs/router-webui/static/style.css @@ -1,56 +1,100 @@ -:root { --fg: #1d2125; --muted: #5b636b; --bg: #fff; --line: #d6dade; --accent: #2457c5; --warn: #fff4d6; --bad: #b3261e; --ok: #e6f2e9; } -@media (prefers-color-scheme: dark) { - :root { --fg: #e4e7ea; --muted: #9aa2aa; --bg: #15181b; --line: #30363c; --accent: #7aa2ff; --warn: #3a3218; --bad: #ff8a80; --ok: #1d3324; } +/* Minimal, neutral, system fonts. Colours are tokens; dark follows the system. */ +:root { + --fg: #c8e6c9; --muted: #6f8f72; --bg: #0a0c0a; --surface: #0d110d; --line: #1f3322; --field: #0a0c0a; + --accent: #4ade80; --on-accent: #04140a; --warn: #2b2a10; --bad: #ff6b6b; --ok: #10281a; --good: #4ade80; + --radius: 0; --shadow: none; + --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace; } * { box-sizing: border-box; } -body { margin: 0; font: 15px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); } -header { display: flex; gap: 1.5rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; } -nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; } +html { color-scheme: dark; scrollbar-color: #2e4a33 var(--bg); scrollbar-width: thin; } +* { scrollbar-color: #2e4a33 var(--bg); scrollbar-width: thin; } +body { margin: 0; font: 13.5px/1.55 var(--mono); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; } +a { color: var(--accent); text-underline-offset: 2px; } +header { position: sticky; top: 0; z-index: 20; display: flex; gap: 2rem; align-items: center; padding: .6rem 1.25rem; + background: var(--bg); border-bottom: 1px solid var(--accent); flex-wrap: wrap; } +header > strong { font-weight: 500; } +header > strong::before { content: "> "; color: var(--accent); } +header > strong::after { content: "_"; color: var(--accent); } +nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; } +nav > a, nav summary, nav button.link { padding: .3rem .65rem; color: var(--fg); text-decoration: none; cursor: pointer; } +nav > a:hover, nav summary:hover, nav details[open] > summary, nav button.link:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); } nav form { display: inline; } -nav details { position: relative; } -nav summary { cursor: pointer; color: var(--accent); list-style: none; } +nav details { position: relative; margin: 0; } +nav summary { list-style: none; } nav summary::-webkit-details-marker { display: none; } -nav summary::after { content: " \25BE"; } -nav details > div { position: absolute; z-index: 10; top: 1.6rem; left: -.75rem; min-width: 11rem; display: flex; flex-direction: column; gap: .35rem; - padding: .6rem .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); } -a { color: var(--accent); } -main { max-width: 72rem; margin: 0 auto; padding: 1rem; } -h1 { font-size: 1.4rem; margin: .5rem 0 1rem; } -h2 { font-size: 1.1rem; margin: 0 0 .5rem; } -section { margin: 0 0 1.25rem; } -section.busy, section.pending { padding: .75rem 1rem; border-radius: 6px; background: var(--warn); } -.flash { padding: .5rem .75rem; background: var(--ok); border-radius: 6px; } +nav summary::after { content: ""; display: inline-block; width: .35rem; height: .35rem; margin: 0 0 .15rem .45rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .55; } +nav details > div { position: absolute; z-index: 30; top: 2.2rem; left: 0; min-width: 12rem; display: flex; flex-direction: column; gap: 1px; + padding: .35rem; background: var(--surface); border: 1px solid var(--accent); } +nav details > div a { padding: .4rem .65rem; border-radius: 0; color: var(--fg); text-decoration: none; } +nav details > div a:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); } +main { max-width: 70rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; } +h1 { font-size: 1.15rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; margin: .25rem 0 1.25rem; } +h1::before { content: "# "; color: var(--accent); } +h2, legend { font-size: .85rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); } +h2 { margin: 0 0 .6rem; } +section { margin: 0 0 1.5rem; } +section.busy, section.pending { padding: .75rem 1rem; border-radius: var(--radius); background: var(--warn); } +.flash, .error { padding: .6rem .9rem; border-radius: var(--radius); margin: 0 0 1rem; } +.flash { background: var(--ok); } +.error { background: color-mix(in srgb, var(--bad) 12%, transparent); } .error, .field-error { color: var(--bad); } .field-error { font-size: .9em; } -.hint { color: var(--muted); font-size: .9em; margin: .25rem 0; } -dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; } +.hint { color: var(--muted); font-size: .9em; margin: .25rem 0 .6rem; } +dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; } dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; } -fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 1rem; padding: .75rem 1rem; overflow-x: auto; } -label { display: inline-flex; flex-direction: column; margin: 0 1rem .5rem 0; font-size: .9em; color: var(--muted); } -input, select, textarea, button { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .3rem .5rem; } -textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; } -table { border-collapse: collapse; } -th { text-align: left; font-weight: 500; color: var(--muted); font-size: .85em; padding: 0 .3rem; } -td { padding: .15rem .3rem; } -button { background: var(--accent); color: var(--bg); border-color: var(--accent); cursor: pointer; padding: .4rem 1rem; } -button.secondary { background: transparent; color: var(--accent); } -button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; } -.actions { display: flex; gap: .75rem; flex-wrap: wrap; } -.narrow { max-width: 22rem; display: flex; flex-direction: column; gap: .75rem; } +fieldset { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 1rem; padding: 1rem 1.15rem; overflow-x: auto; min-width: 0; } +legend { float: left; width: 100%; padding: 0; margin: 0 0 .7rem; } +legend ~ * { clear: both; } + +/* Fields: a caption above the input */ +label { display: inline-flex; flex-direction: column; gap: .2rem; margin: 0 1rem .6rem 0; font-size: .85em; font-weight: 500; color: var(--muted); } +input, select, textarea, button { font: inherit; color: var(--fg); background: var(--field); border: 1px solid var(--line); border-radius: 0; padding: .4rem .6rem; } +input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--fg) 30%, var(--line)); } +input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--accent); border-color: var(--accent); } +input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); } +textarea { width: 100%; font-size: 13px; } +.narrow { max-width: 24rem; display: flex; flex-direction: column; gap: .8rem; } .narrow label { margin: 0; } -pre.log { background: color-mix(in srgb, var(--line) 35%, transparent); padding: .75rem; border-radius: 6px; overflow-x: auto; font-size: 12.5px; max-height: 30rem; } -code { font-size: .9em; overflow-wrap: anywhere; } + +/* Ticks: a switch in front of its text; a plain small box inside tables */ +label:has(> input[type=checkbox]) { flex-direction: row; align-items: center; gap: .6rem; font-size: 1em; font-weight: 400; color: var(--fg); margin: 0 1.25rem .5rem 0; } +fieldset > label:has(> input[type=checkbox]), form > label:has(> input[type=checkbox]) { display: flex; } +input[type=checkbox] { appearance: none; flex: none; width: 2.4rem; height: 1.2rem; padding: 0; margin: 0; border-radius: 0; position: relative; cursor: pointer; + background: #1c2a1e; border: 0; transition: background .15s; vertical-align: middle; } +input[type=checkbox]::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: .9rem; height: .9rem; border-radius: 0; background: var(--muted); transition: transform .15s; } +input[type=checkbox]:checked { background: #14532d; } +input[type=checkbox]:checked::after { transform: translateX(1.2rem); background: var(--accent); } +td > input[type=checkbox], th > input[type=checkbox], p > label > input[type=checkbox] { width: 1.05rem; height: 1.05rem; border-radius: 0; border: 1.5px solid color-mix(in srgb, var(--fg) 40%, transparent); background: var(--field); } +td > input[type=checkbox]::after, th > input[type=checkbox]::after, p > label > input[type=checkbox]::after { display: none; } +td > input[type=checkbox]:checked, th > input[type=checkbox]:checked, p > label > input[type=checkbox]:checked { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='%2304140a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 90% no-repeat; border-color: var(--accent); } +td:has(> input[type=checkbox]) { text-align: center; } + +/* Buttons */ +button { background: transparent; color: var(--accent); border-color: var(--accent); cursor: pointer; text-transform: uppercase; letter-spacing: .06em; padding: .4rem 1.05rem; } +button:hover { background: var(--accent); color: var(--on-accent); } +button.secondary { border-color: var(--line); color: var(--fg); } +button.secondary:hover { border-color: var(--accent); background: transparent; color: var(--accent); } +button.link { background: none; border: none; color: var(--fg); padding: .3rem .65rem; text-transform: none; letter-spacing: 0; } +button.link:hover { background: none; } +.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; } + +/* Tables */ +table { border-collapse: collapse; } +th { text-align: left; font-weight: 500; color: var(--accent); font-size: .8em; text-transform: uppercase; letter-spacing: .03em; padding: 0 .4rem .3rem; white-space: nowrap; } +td { padding: .2rem .4rem; } +pre.log { background: color-mix(in srgb, var(--fg) 5%, transparent); padding: .85rem 1rem; border-radius: var(--radius); overflow-x: auto; font-size: 12.5px; max-height: 30rem; } +code { font-size: .88em; overflow-wrap: anywhere; background: color-mix(in srgb, var(--fg) 7%, transparent); padding: .1em .35em; border-radius: 0; } +pre code { background: none; padding: 0; } .muted { color: var(--muted); } .bad { color: var(--bad); } .ok { color: var(--good); } -:root { --good: #1e7b34; --s0: #2457c5; --s1: #d9730d; --s2: #2f9e44; --s3: #9c36b5; --s4: #c92a2a; --s5: #0b7285; --s6: #862e9c; --s7: #5c940d; --s8: #a61e4d; --s9: #5f3dc4; } -@media (prefers-color-scheme: dark) { :root { --good: #69db7c; --s0: #7aa2ff; --s1: #ffa94d; --s2: #69db7c; --s3: #da77f2; --s4: #ff8787; --s5: #66d9e8; --s6: #e599f7; --s7: #c0eb75; --s8: #faa2c1; --s9: #b197fc; } } +:root { --s0: #8ba4ff; --s1: #ffa94d; --s2: #69db7c; --s3: #da77f2; --s4: #ff8787; --s5: #66d9e8; --s6: #e599f7; --s7: #c0eb75; --s8: #faa2c1; --s9: #b197fc; } .ranges { display: flex; gap: .25rem; margin: 0 0 1rem; } -.ranges a { padding: .2rem .7rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; } -.ranges a.active { background: var(--accent); color: var(--bg); border-color: var(--accent); } +.ranges a { padding: .2rem .75rem; border: 1px solid var(--line); border-radius: 0; text-decoration: none; color: var(--fg); background: var(--surface); } +.ranges a:hover, .ranges a.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); } .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 0 0 1.25rem; } -.card { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: .75rem 1rem; margin: 0; } +.card { background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); box-shadow: var(--shadow); padding: .85rem 1.1rem; margin: 0; } .card.up { border-left-color: var(--good); } .card.degraded { border-left-color: #e8a600; } .card.down { border-left-color: var(--bad); } @@ -58,10 +102,10 @@ code { font-size: .9em; overflow-wrap: anywhere; } .card dl { margin: 0; font-size: .92em; } .events { list-style: none; margin: 0; padding: 0; font-size: .9em; } .events li span:first-child { display: inline-block; width: 2.5rem; font-weight: 600; } -.scroll { overflow-x: auto; } +.scroll { overflow-x: auto; min-width: 0; } .leases td, .leases th { padding: .2rem .75rem .2rem 0; white-space: nowrap; } .charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 1rem; margin: 0 0 1.5rem; } -.chart { margin: 0; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; min-width: 0; } +.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .65rem .9rem; min-width: 0; } .chart figcaption { display: flex; flex-wrap: wrap; gap: .25rem 1rem; justify-content: space-between; font-size: .9em; } .legend { display: flex; flex-wrap: wrap; gap: .1rem .9rem; } .key::before { content: ""; display: inline-block; width: .7rem; height: .2rem; margin: 0 .3rem .2rem 0; background: currentColor; vertical-align: middle; } @@ -77,7 +121,7 @@ code { font-size: .9em; overflow-wrap: anywhere; } .s5 { color: var(--s5); stroke: var(--s5); } .s6 { color: var(--s6); stroke: var(--s6); } .s7 { color: var(--s7); stroke: var(--s7); } .s8 { color: var(--s8); stroke: var(--s8); } .s9 { color: var(--s9); stroke: var(--s9); } /* WireGuard */ -.qr svg { width: 14rem; height: 14rem; background: #fff; } +.qr svg { width: 14rem; height: 14rem; background: #fff; padding: .5rem; } pre { overflow-x: auto; white-space: pre-wrap; word-break: break-all; } form.inline { margin-top: 0.5rem; } details { margin: 0.5rem 0; }