From ba8f081825f99424315def102eb014cd12c5a48c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 25 Oct 2026 12:57:49 -1000 Subject: Highlight list rows on hover only under a mouse On a touch screen the highlight stayed on whichever row was tapped last. --- assets/cgit.css | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'assets') diff --git a/assets/cgit.css b/assets/cgit.css index cf62df8..7a4472a 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -366,28 +366,30 @@ div#cgit table.list tr:nth-child(odd) { background: var(--bg); } -div#cgit table.list tr:hover { - background: var(--row-hover); -} - div#cgit table.list tr.nohover { background: var(--bg); } -div#cgit table.list tr.nohover:hover { - background: var(--bg); -} - div#cgit table.list tbody + tbody > tr:first-child > th { padding-top: calc(1lh + 0.95em); } -div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { - background: var(--surface-2); -} +@media (hover: hover) { + div#cgit table.list tr:hover { + background: var(--row-hover); + } -div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { - background: var(--bg); + div#cgit table.list tr.nohover:hover { + background: var(--bg); + } + + div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { + background: var(--surface-2); + } + + div#cgit table.list tr.nohover-highlight:hover:nth-child(odd) { + background: var(--bg); + } } div#cgit table.list th { -- cgit 2.9.2