about summary refs log tree commit diff
path: root/cgit.css
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-17 19:27:59 +0000
committerRory& <root@rory.gay>2026-02-06 14:09:56 +0100
commit926519c6049c8e9de8711e349a7651f5f91869bd (patch)
tree6a4d6ba3d032e4d206fcecb72ab9cb52c8e086f8 /cgit.css
parentUse buffered stdio (diff)
downloadcgit-magenta-926519c6049c8e9de8711e349a7651f5f91869bd.tar.xz
Use <pre> and <span> to print diffs
This correctly preserves whitespace in browsers without CSS, as an
alternative to [1].

[1]: https://80x24.org/cgit.git/commit/?id=7c692e6137697de8a8473c4de5c3de4fb03a2989
Diffstat (limited to 'cgit.css')
-rw-r--r--cgit.css14
1 files changed, 4 insertions, 10 deletions
diff --git a/cgit.css b/cgit.css

index 1fbab2e..51ddbf8 100644 --- a/cgit.css +++ b/cgit.css
@@ -537,26 +537,20 @@ div#cgit table.diff { width: 100%; } -div#cgit table.diff td { - font-family: monospace; - white-space: pre; -} - -div#cgit table.diff td div.head { +div#cgit table.diff td span.head { font-weight: bold; - margin-top: 1em; color: black; } -div#cgit table.diff td div.hunk { +div#cgit table.diff td span.hunk { color: #009; } -div#cgit table.diff td div.add { +div#cgit table.diff td span.add { color: green; } -div#cgit table.diff td div.del { +div#cgit table.diff td span.del { color: red; }