From e56461626321209c816b2836b62b7d0d91d9eb96 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 15 Jul 2026 11:03:18 -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 v2.8.0