Skip to content

Build your personal knowledge base with Trilium Notes

8.4 KB
Raw Blame
ul.fancytree-container {
    padding-inline-start: 0;
}

ul.fancytree-container li {
    list-style: none;
}

span.fancytree-node.fancytree-hide {
    display: none;
}

.fancytree-title {
    flex-basis: 0; /* to allow shrinking text to make space for buttons */
    flex-shrink: 1;
    flex-grow: 1;
    overflow: hidden;
    margin-inline-start: 7px;
    outline: none;
}

.fancytree-expander {
    visibility: hidden;
}

.fancytree-folder .fancytree-expander {
    visibility: visible;
}

.fancytree-node {
    display: flex;
    align-items: center;
    /* The line box follows the tree font; the space around it stays fixed. */
    height: calc(1lh + 14px);
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    user-select: none !important;
    -webkit-user-select: none !important;
    color: var(--custom-color, inherit);
}

.tree-wrapper.dense {
    .fancytree-node {
        height: calc(1lh + 6px);
    }

    .fancytree-title {
        font-size: 0.9em;
    }

    .tn-icon.tree-item-button {
        font-size: 1em;
    }
}

.fancytree-node:not(.fancytree-loading) .fancytree-expander {
    background: none;
    height: auto;
    text-align: center;
}

.fancytree-node:not(.fancytree-loading) .fancytree-expander:before {
    font-family: "boxicons" !important;
    content: "\ea50"; /* lookup code for "chevron-right" in boxicons.css */
    speak: none;
    font-size: x-large;
    text-transform: none;
    line-height: 1;
    position: relative;
    top: 2px;
    margin-inline-end: 5px;
}

body[dir=rtl] .fancytree-node:not(.fancytree-loading):not(.fancytree-expanded) .fancytree-expander:before {
    content: "\ea4d";   /* bx bx-chevron-left */
}

.fancytree-loading span.fancytree-expander {
    background-image: none;
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 4px 8px 2px 5px;
}

.fancytree-loading span.fancytree-expander:after {
    content: " ";
    color: inherit !important;
    display: block;
    border-radius: 50%;
    border-color: var(--main-text-color) transparent var(--main-text-color) transparent;
    animation: lds-dual-ring 1.2s linear infinite;
    width: 12px;
    height: 12px;
    margin-top: 2px;
    margin-inline-start: 1px;
    border-width: 1px;
    border-style: solid;
}

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

ul.fancytree-container li {
    contain: layout paint;
}

/* this is done to preserve correct indentation. Better solution would be preferable */
.fancytree-node:not(.fancytree-folder) .fancytree-expander:before {
    color: var(--main-background-color); /* setting to background color makes this invisible */
}

.fancytree-node.fancytree-expanded .fancytree-expander:before {
    font-family: "boxicons" !important;
    content: "\ea4a"; /* lookup code for "chevron-down" in boxicons.css */
}

/** some common text styling for cssClass label */
span.fancytree-node.underline .fancytree-title {
    text-decoration: underline;
}
span.fancytree-node.dotted .fancytree-title {
    text-decoration: dotted;
}
span.fancytree-node.bold .fancytree-title {
    font-weight: bold;
}
span.fancytree-node.muted {
    opacity: 0.6;
}

/** following will hide ancestors of hoisted (filtered) note */
.fancytree-submatch:not(.fancytree-match) {
    display: none !important;
}

/** resets indent of hoisted note */
.fancytree-submatch:not(.fancytree-match) + ul {
    padding: 0 !important;
}

ul.fancytree-container {
    outline: none;
    background-color: inherit;
}


.fancytree-custom-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1em;
    height: 1em;
    font-size: 1.2em;
}

/* Fallback icon */
:where(.fancytree-custom-icon)::before {
    content: "?";
}

/* Protected note icon badge */
span.fancytree-node.protected > span.fancytree-custom-icon {
    filter: drop-shadow(2px 2px 2px var(--main-text-color));
}

.fancytree-title .protected-title {
    font-style: italic;
    opacity: .75;
}

/* Note indicator icons (clone, shared) - real DOM elements for tooltip support */
.note-indicator-icon {
    font-family: "boxicons" !important;
    font-size: smaller;
    margin-inline-start: 4px;
    opacity: 0.8;
    cursor: help;
}

.note-indicator-icon.clone-indicator::before {
    content: "\ed82";
    opacity: 0.5;
}

.note-indicator-icon.shared-indicator::before {
    content: "\ec03"; /* bx-share-alt */
}

span.fancytree-node.fancytree-active-clone:not(.fancytree-active) .fancytree-title {
    font-weight: bold;
}

/* first nesting level has lower left padding to avoid extra left padding. Other levels are not affected */
.ui-fancytree > li > ul {
    padding-inline-start: 5px;
}

.ui-fancytree ul {
    padding-inline-start: 20px;
}

span.fancytree-active {
    color: var(--active-item-text-color);
    background-color: var(--active-item-background-color);
    border-color: transparent; /* invisible border */
    border-radius: 5px;
}

span.fancytree-active .fancytree-title {
    font-weight: bold;
    border: 0;
}

span.fancytree-node.fancytree-selected {
    background-color: var(--selection-background-color);
    border-radius: 0;
}

span.fancytree-selected .fancytree-custom-icon::before {
    font-family: "boxicons";
    content: "\ef05";
    border: 1px solid var(--main-text-color);
    border-radius: 3px;
}

span.fancytree-node:hover {
    border: 1px solid var(--main-border-color);
}

span.fancytree-node.fancytree-menu-target {
    box-shadow: inset 0 0 0 1px var(--main-border-color);
}

.fancytree-title:hover,
span.fancytree-node:hover .fancytree-title {
    border: 0;
}

span.fancytree-node.archived {
    opacity: 0.6;
}

.fancytree-node:hover .tn-icon.tree-item-button {
    display: inline-block;
}

.tn-icon.tree-item-button {
    display: none;
    font-size: 120%;
    cursor: pointer;
    margin-inline-start: 8px;
    padding: 1px;
    border: 1px solid transparent;
    border-radius: 5px;
}

.unhoist-button.tn-icon.tree-item-button {
    margin-inline-start: 0; /* unhoist button is on the left and doesn't need more margin */
    display: block; /* keep always visible */
}

.tree-item-button:hover {
    border: 1px dotted var(--main-text-color);
}

.add-note-button {
    display: none;
}

span.fancytree-node:hover .add-note-button {
    display: inline-block;
}

.fancytree-drop-accept {
    border: 1px solid var(--main-border-color);
}

#fancytree-drop-marker.fancytree-drop-after,
#fancytree-drop-marker.fancytree-drop-before {
    width: 100px;
    /* marker is by default position: relative which doesn't make sense */
    position: absolute !important;
    /* dnd5 anchors the marker by its own vertical centre (`my: "left center"`) on the target
       title's top or bottom edge, so any height offsets the line by half of it. At zero the
       centre is the edge, which holds whatever height a row or its font takes. */
    height: 0;
}

/*
 * Both hit modes name the same place to drop into, so both draw on the boundary between the two
 * rows: the title above's bottom edge moves down to reach it, the title below's top edge moves up.
 * The distance is measured per row by publishDropMarkerShift() in note_tree.ts.
 */
#fancytree-drop-marker.fancytree-drop-after {
    --drop-marker-shift: var(--tree-drop-marker-shift, 0px);
}

#fancytree-drop-marker.fancytree-drop-before {
    --drop-marker-shift: calc(-1 * var(--tree-drop-marker-shift, 0px));
}

/*
 * The line, and the ring capping the end it is measured from. Both are drawn by pseudo-elements so
 * the marker's own box stays at zero height: dnd5 positions that box, and a border on it would
 * carry the line half its thickness off the edge.
 */
#fancytree-drop-marker.fancytree-drop-after::before,
#fancytree-drop-marker.fancytree-drop-before::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: calc(-1px + var(--drop-marker-shift, 0px));
    height: 2px;
    border-radius: 1px;
    background: var(--muted-text-color);
}

#fancytree-drop-marker.fancytree-drop-after::after,
#fancytree-drop-marker.fancytree-drop-before::after {
    content: "";
    position: absolute;
    inset-inline-start: -2px;
    top: calc(-4px + var(--drop-marker-shift, 0px));
    box-sizing: border-box;
    width: 8px;
    height: 8px;
    border: 2px solid var(--muted-text-color);
    border-radius: 50%;
    /* Hollow, so the row beneath reads through it rather than being covered by a dot. */
    background: var(--main-background-color);
}