commit 5241fe95
Make the blame area larger and make text more visible in Dark mode
Changed files
| M | static/style.css before |
| M | templates/repo.tmpl before |
diff --git a/static/style.css b/static/style.css
index 135bf2c..6064a92 100644
--- a/static/style.css
+++ b/static/style.css
@@ -119,6 +119,7 @@ a:hover { text-decoration: underline; }
.theme-toggle.push { margin-left: auto; }
main { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
+main:has(> .blame-scroll) { max-width: 1600px; }
h1 { font-size: 1.5rem; word-break: break-all; margin-top: 0; }
h2 { font-size: 1.15rem; }
@@ -271,13 +272,16 @@ pre.code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, mono
.readme th, .readme td { padding: 0.4rem 0.75rem; border: 1px solid var(--border-subtle); }
.readme blockquote { margin: 1rem 0; padding: 0 1rem; color: var(--muted); border-left: 3px solid var(--border); }
-table.blame { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
-table.blame td { padding: 0 0.5rem; border: none; vertical-align: top; }
+.blame-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
+table.blame { width: 100%; border-collapse: collapse; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
+table.blame td { padding: 0 0.5rem; border: none; vertical-align: top; white-space: nowrap; }
table.blame tr:hover td { background: var(--row-hover); }
table.blame .commit { color: var(--link); }
-table.blame .author { color: var(--muted); white-space: nowrap; }
-table.blame .date { color: var(--muted); white-space: nowrap; }
+table.blame .author { color: var(--muted); }
+table.blame .author span { display: inline-block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
+table.blame .date { color: var(--muted); }
table.blame .lineno { color: var(--muted); text-align: right; user-select: none; }
+table.blame .line { width: 100%; }
table.blame .line pre { margin: 0; white-space: pre; }
.log .msg { width: 100%; }
@@ -302,6 +306,7 @@ table.tree .before { margin-left: 0.5rem; font-size: 0.8rem; color: var(--muted)
.diff .d-hunk { background: var(--bg-subtle); color: var(--muted); }
.diff .d-file { background: var(--bg-subtle); font-weight: 600; }
+:root[data-theme="dark"] .hljs { color: var(--fg); }
:root[data-theme="dark"] .hljs-doctag, :root[data-theme="dark"] .hljs-keyword,
:root[data-theme="dark"] .hljs-meta .hljs-keyword, :root[data-theme="dark"] .hljs-template-tag,
:root[data-theme="dark"] .hljs-template-variable, :root[data-theme="dark"] .hljs-type,
diff --git a/templates/repo.tmpl b/templates/repo.tmpl
index 0523618..88ae6be 100644
--- a/templates/repo.tmpl
+++ b/templates/repo.tmpl
@@ -147,17 +147,19 @@
<a href="/repos/<%= repo %>/tree/<%= path %><%= query %>">normal view</a> ·
<a href="/repos/<%= repo %>/raw/<%= path %><%= query %>">raw</a>
</p>
+<div class="blame-scroll">
<table class="blame">
<% foreach l in lines %><% item %>
<tr>
<td class="commit"><a href="/repos/<%= repo %>/commit/<%= l.short_oid %>"><%= l.short_oid %></a></td>
-<td class="author"><%= l.author %></td>
+<td class="author"><span><%= l.author %></span></td>
<td class="date"><% c++ out() << util::format_time(l.time); %></td>
<td class="lineno"><%= l.number %></td>
<td class="line"><pre><%= l.content %></pre></td>
</tr>
<% end item %><% end foreach %>
</table>
+</div>
<% end template %>
<% end view %>