FossilRepo

Fix code line number padding — use !important to override Tailwind td reset

lmata 2026-04-06 21:10 trunk
Commit bb81b10a2b26ff32b41d62fcfd63fc310e68c419b68012fce847402210ea8f18
--- templates/fossil/code_file.html
+++ templates/fossil/code_file.html
@@ -4,22 +4,21 @@
44
{% block extra_head %}
55
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
66
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
77
<style>
88
.code-table { border-collapse: collapse; width: 100%; }
9
- .code-table td { padding: 0; vertical-align: top; }
10
- .line-num {
11
- width: 1%; white-space: nowrap; padding: 0 16px;
9
+ .code-table td.line-num {
10
+ width: 1%; white-space: nowrap; padding: 0 16px !important;
1211
text-align: right; user-select: none; cursor: pointer;
1312
color: #4b5563; font-size: 0.75rem; line-height: 1.5rem;
14
- border-right: 1px solid #374151;
13
+ border-right: 1px solid #374151; vertical-align: top;
1514
}
16
- .line-num:hover { color: #DC394C; }
17
- .line-num a { color: inherit; text-decoration: none; display: block; }
18
- .line-code {
19
- white-space: pre; padding: 0 16px;
20
- font-size: 0.8125rem; line-height: 1.5rem;
15
+ .code-table td.line-num:hover { color: #DC394C; }
16
+ .code-table td.line-num a { color: inherit; text-decoration: none; display: block; }
17
+ .code-table td.line-code {
18
+ white-space: pre; padding: 0 16px !important;
19
+ font-size: 0.8125rem; line-height: 1.5rem; vertical-align: top;
2120
}
2221
.line-row:hover { background: rgba(220, 57, 76, 0.05); }
2322
.line-row:target { background: rgba(220, 57, 76, 0.12); }
2423
.line-row:target .line-num { color: #DC394C; font-weight: 600; }
2524
.line-row { scroll-margin-top: 40vh; }
2625
--- templates/fossil/code_file.html
+++ templates/fossil/code_file.html
@@ -4,22 +4,21 @@
4 {% block extra_head %}
5 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
6 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
7 <style>
8 .code-table { border-collapse: collapse; width: 100%; }
9 .code-table td { padding: 0; vertical-align: top; }
10 .line-num {
11 width: 1%; white-space: nowrap; padding: 0 16px;
12 text-align: right; user-select: none; cursor: pointer;
13 color: #4b5563; font-size: 0.75rem; line-height: 1.5rem;
14 border-right: 1px solid #374151;
15 }
16 .line-num:hover { color: #DC394C; }
17 .line-num a { color: inherit; text-decoration: none; display: block; }
18 .line-code {
19 white-space: pre; padding: 0 16px;
20 font-size: 0.8125rem; line-height: 1.5rem;
21 }
22 .line-row:hover { background: rgba(220, 57, 76, 0.05); }
23 .line-row:target { background: rgba(220, 57, 76, 0.12); }
24 .line-row:target .line-num { color: #DC394C; font-weight: 600; }
25 .line-row { scroll-margin-top: 40vh; }
26
--- templates/fossil/code_file.html
+++ templates/fossil/code_file.html
@@ -4,22 +4,21 @@
4 {% block extra_head %}
5 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
6 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
7 <style>
8 .code-table { border-collapse: collapse; width: 100%; }
9 .code-table td.line-num {
10 width: 1%; white-space: nowrap; padding: 0 16px !important;
 
11 text-align: right; user-select: none; cursor: pointer;
12 color: #4b5563; font-size: 0.75rem; line-height: 1.5rem;
13 border-right: 1px solid #374151; vertical-align: top;
14 }
15 .code-table td.line-num:hover { color: #DC394C; }
16 .code-table td.line-num a { color: inherit; text-decoration: none; display: block; }
17 .code-table td.line-code {
18 white-space: pre; padding: 0 16px !important;
19 font-size: 0.8125rem; line-height: 1.5rem; vertical-align: top;
20 }
21 .line-row:hover { background: rgba(220, 57, 76, 0.05); }
22 .line-row:target { background: rgba(220, 57, 76, 0.12); }
23 .line-row:target .line-num { color: #DC394C; font-weight: 600; }
24 .line-row { scroll-margin-top: 40vh; }
25

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button