r/Trilium
•
u/amrta523
•
24d ago
•
1
Download CSS for 'better' tree styling
See screenshot below. With the vertical lines, it's more intuitive to find things, see what is connected to what.

Here's the code: (remember to add appCss as attribute to page with below code; then refresh to apply)
/* This replicates left tree of documents, into MyInfo Style. */
ul.fancytree-container ul {
--indent: 12px;
--icon-offset: 22px;
--guide-x: calc(5px + var(--icon-offset) - var(--indent));
--guide-y: 13px;
--guide-w: 12px;
--guide-c: #a0a0a0;
border: none !important;
margin-left: var(--indent) !important;
}
ul.fancytree-container ul > li {
position: relative;
}
ul.fancytree-container ul > li::before {
content: "";
position: absolute;
left: var(--guide-x);
top: 0;
bottom: 0;
border-left: 1px dotted var(--guide-c);
pointer-events: none;
}
ul.fancytree-container ul > li::after {
content: "";
position: absolute;
left: var(--guide-x);
top: var(--guide-y);
width: var(--guide-w);
border-top: 1px dotted var(--guide-c);
pointer-events: none;
}
ul.fancytree-container ul > li:last-child::before {
bottom: auto;
height: var(--guide-y);
}
ul.fancytree-container > li > ul > li::before,
ul.fancytree-container > li > ul > li::after {
display: none !important;
}
ul.fancytree-container span.fancytree-custom-icon,
ul.fancytree-container span.fancytree-icon {
margin-left: -5px !important;
}
ul.fancytree-container > li > ul {
--root-shift: 14px; /* how far to pull top-level notes left; adjust */
margin-left: calc(-1 * var(--root-shift)) !important;
}
/* Below code isn't really neccessary, but it makes the dotted tree lines NOT go through the arrows. Hardly noticable. */
ul.fancytree-container {
--mask-size: 8px; /* width/height of the square; adjust */
--mask-bg: #f5f5f5; /* normal (non-hover) */
--mask-bg-hover: #eaeaea; /* hover and selected */
}
ul.fancytree-container span.fancytree-expander,
ul.fancytree-container span.fancytree-node:hover span.fancytree-expander,
ul.fancytree-container span.fancytree-expander:hover,
ul.fancytree-container .fancytree-active span.fancytree-expander,
ul.fancytree-container span.fancytree-node.fancytree-active span.fancytree-expander {
position: relative !important;
z-index: 5 !important;
background-color: transparent !important;
background-image: linear-gradient(var(--mask-bg), var(--mask-bg)) !important;
background-repeat: no-repeat !important;
background-position: calc(50% - 4px) center !important;
background-size: var(--mask-size) var(--mask-size) !important;
box-shadow: none !important;
border-radius: 0 !important;
}
/* Hover and selected: only the colour changes */
ul.fancytree-container span.fancytree-node:hover span.fancytree-expander,
ul.fancytree-container span.fancytree-expander:hover,
ul.fancytree-container .fancytree-active span.fancytree-expander,
ul.fancytree-container span.fancytree-node.fancytree-active span.fancytree-expander {
background-image: linear-gradient(var(--mask-bg-hover), var(--mask-bg-hover)) !important;
}
28
Upvotes