Skip to content

Commit a3ae7fa

Browse files
committed
style: Update tree lines and arrows for improved layout and visual consistency
1 parent 7478a23 commit a3ae7fa

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,11 @@
907907
function getTreeLines(parents, isLast) {
908908
let lines = '';
909909
for (let i = 0; i < parents.length; ++i) {
910-
lines += `<span class="tree-vline" style="visibility:${parents[i] ? 'visible' : 'hidden'}"></span>`;
910+
if (parents[i]) {
911+
lines += `<span class="tree-vline"></span>`;
912+
} else {
913+
lines += `<span class="tree-vline" style="opacity:0"></span>`;
914+
}
911915
}
912916
if (parents.length > 0) {
913917
lines += `<span class="tree-branch${isLast ? ' tree-branch-last' : ''}"></span>`;

style.css

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,36 @@
4040
margin-right: 8px;
4141
margin-bottom: 2px;
4242
}
43-
/* Tree lines and arrows */
4443
/* Tree lines and arrows (VS Code style) */
4544
.tree-lines {
46-
display: inline-block;
47-
min-width: 0.7em;
48-
vertical-align: middle;
45+
display: inline-flex;
46+
align-items: center;
47+
height: 22px;
48+
margin-right: 2px;
4949
user-select: none;
50-
letter-spacing: -0.1em;
5150
}
5251
.tree-vline {
5352
display: inline-block;
54-
width: 1.5px;
53+
width: 1px;
5554
height: 22px;
56-
background: #444;
57-
margin-right: 2px;
58-
margin-left: 0;
59-
border-radius: 1px;
60-
position: relative;
61-
top: 2px;
55+
background: #4a4a4a;
56+
margin: 0 7.5px;
57+
flex-shrink: 0;
6258
}
6359
.tree-branch {
64-
width: 16px;
65-
height: 22px;
66-
background: none;
67-
border-left: 2px solid #444;
68-
border-bottom: 2px solid #444;
69-
border-radius: 0 0 0 2px;
70-
margin-right: 2px;
71-
margin-left: -2px;
72-
position: relative;
73-
top: 2px;
74-
left: -2px;
60+
display: inline-block;
61+
width: 8px;
62+
height: 11px;
63+
border-left: 1px solid #4a4a4a;
64+
border-bottom: 1px solid #4a4a4a;
65+
margin: 0 7.5px 0 0;
66+
flex-shrink: 0;
67+
align-self: flex-start;
68+
margin-top: -11px;
7569
}
7670
.tree-branch-last {
77-
border-left: 2px solid transparent !important;
71+
height: 11px;
72+
border-left: 1px solid #4a4a4a !important;
7873
}
7974
.tree-arrow {
8075
width: 14px;

0 commit comments

Comments
 (0)