diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-08 09:40:34 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-08 09:40:34 +0300 |
| commit | 0589d0a21f3273cb99b7d723531cd489911f5aef (patch) | |
| tree | 765e6d22c45eafa4e6cc2f3b6ec60d11c55af1c2 | |
| parent | c0f36f30378ea6315768522940c275841150bd6a (diff) | |
HTML: make output much more compact and full-width; auto-size tables to content to avoid large empty columns
| -rw-r--r-- | foostats.pl | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/foostats.pl b/foostats.pl index 7dbc26d..7418a98 100644 --- a/foostats.pl +++ b/foostats.pl @@ -926,55 +926,55 @@ package Foostats::Reporter { <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>$title</title> <style> - body { - font-family: monospace; - line-height: 1.6; - max-width: 80ch; - margin: 0 auto; - padding: 1em; - background: white; - color: black; + /* Compact, full-width layout */ + :root { + --pad: 8px; + } + html, body { + height: 100%; } - h1, h2, h3 { - font-weight: bold; - margin-top: 1em; - margin-bottom: 0.5em; + body { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + line-height: 1.3; + margin: 0; + padding: var(--pad); + background: #fff; + color: #000; } - h1 { font-size: 1.2em; } - h2 { font-size: 1.1em; } - h3 { font-size: 1em; } + /* Headings: smaller and tighter */ + h1, h2, h3 { margin: 0.5em 0 0.25em; font-weight: 600; } + h1 { font-size: 1em; } + h2 { font-size: 0.95em; } + h3 { font-size: 0.9em; } + /* Paragraphs and lists: minimal vertical rhythm */ + p { margin: 0.2em 0; } + ul { margin: 0.3em 0; padding-left: 1.2em; } + li { margin: 0.1em 0; } + /* Code blocks and tables */ pre { overflow-x: auto; white-space: pre; - font-family: monospace; + margin: 0.3em 0; } table { border-collapse: collapse; - margin: 1em 0; + table-layout: auto; /* size columns by content */ + width: auto; /* do not stretch to full width */ + max-width: 100%; + margin: 0.5em 0; + font-size: 0.95em; + display: inline-table; /* keep as compact as content allows */ } th, td { - padding: 0.25em 0.5em; + padding: 0.1em 0.3em; text-align: left; + white-space: nowrap; /* avoid wide columns caused by wrapping */ } - a { - color: blue; - text-decoration: underline; - } - a:visited { - color: purple; - } - hr { - border: none; - border-top: 1px solid #ccc; - margin: 1em 0; - } - ul { - margin: 0.5em 0; - padding-left: 2em; - } - li { - margin: 0.25em 0; - } + /* Links */ + a { color: #06c; text-decoration: underline; } + a:visited { color: #639; } + /* Rules */ + hr { border: none; border-top: 1px solid #ccc; margin: 0.5em 0; } </style> </head> <body> |
