From 775aa0f5086a6b64f4dc1c28f6843b3b11b15c8a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 15:10:36 -1000 Subject: Add built-in syntax highlighting Highlighting previously required a source filter shelling out to something like Pygments. A configured source filter still takes precedence, every character is preserved so the line gutter stays aligned, and large files are skipped. --- assets/cgit.css | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'assets/cgit.css') diff --git a/assets/cgit.css b/assets/cgit.css index 4504702..96192e4 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -601,6 +601,13 @@ div#cgit table.blob td.linenumbers a:target:before { content: "\2BA9"; } +/* Tokens produced by the client-side highlighter in cgit.js. */ +div#cgit .hl-comment { color: light-dark(#6a737d, #8b949e); font-style: italic; } +div#cgit .hl-keyword { color: light-dark(#cf222e, #ff7b72); } +div#cgit .hl-string { color: light-dark(#0a7d24, #7ee787); } +div#cgit .hl-number { color: light-dark(#0550ae, #79c0ff); } + + /* ---- Blame ------------------------------------------------------------ */ div#cgit table.blame { -- cgit 2.12.1