From a398089301c24bf9f7858fd1fb123b86b4d37e8f Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 21 Oct 2023 18:44:58 +0800 Subject: [PATCH] Improve diff tree spacing (#27714) (#27719) Backport #27714 by @silverwind 1. Un-indent top-level items, matching GitHub rendering 2. Increase item padding and add 1px gap between items Before and After: Screenshot 2023-10-20 at 18 37 32 Screenshot 2023-10-20 at 18 40 46 Co-authored-by: silverwind Co-authored-by: 6543 --- web_src/js/components/DiffFileTree.vue | 10 +++++++++- web_src/js/components/DiffFileTreeItem.vue | 11 +++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue index 6136f7b94..3686629df 100644 --- a/web_src/js/components/DiffFileTree.vue +++ b/web_src/js/components/DiffFileTree.vue @@ -126,7 +126,7 @@ export default { }; + diff --git a/web_src/js/components/DiffFileTreeItem.vue b/web_src/js/components/DiffFileTreeItem.vue index 553ab1464..22c23f3ca 100644 --- a/web_src/js/components/DiffFileTreeItem.vue +++ b/web_src/js/components/DiffFileTreeItem.vue @@ -58,11 +58,14 @@ a, a:hover { } .sub-items { - padding-left: 9px; + display: flex; + flex-direction: column; + gap: 1px; + padding-left: 8px; } -.item-file { - margin-left: 20px; +.sub-items .item-file { + padding-left: 24px; } .item-file.selected { @@ -80,7 +83,7 @@ a, a:hover { display: flex; align-items: center; gap: 0.25em; - padding: 2px; + padding: 3px 6px; } .item-file:hover,