Skip to content

Build your personal knowledge base with Trilium Notes

2.3 KB
Raw Blame
/*
 * The picker's own dressing. Written under the class the picker brings rather than the note icon
 * widget's, which it used to live inside; the themes still reach the grid through the legacy class
 * the picker also carries.
 */
.icon-picker .filter-row {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 1em;
}

.icon-picker .filter-row span {
    display: block;
    font-weight: bold;
}

/*
 * Tall enough to pick from, and never taller than the screen. Floating UI keeps the panel in view by
 * shifting it, which works only while the panel is smaller than the viewport. The subtraction
 * leaves room for the search row above the grid, the panel's padding, and the toggle.
 */
.icon-picker .icon-list {
    --scroll-fade-top: 20px;
    /* Added to the width set in IconPicker.tsx, so the inset cells do not overflow sideways. */
    --icon-list-inset: 6px;
    height: clamp(12rem, 100vh - 8rem, 500px);
    overflow: auto;
}

.icon-picker .icon-list > [role="grid"] {
    padding-bottom: var(--scroll-fade-top);
}

.icon-picker .icon-list span {
    display: inline-block;
    padding: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 180%;
    /* Keeps the first row clear of the `.scroll-edge-fade` mask while the grid is at the top. */
    top: var(--scroll-fade-top);
    /* The cells carry an inline `left`, so a margin is what moves them off the edge. */
    margin-inline-start: var(--icon-list-inset);
}

.icon-picker .icon-list span:hover {
    border: 1px solid var(--hover-item-border-color);
}

.icon-picker.compact .filter-row {
    padding: 6px 6px 0;
    gap: 0.5em;
    font-size: 0.85em;
}

.icon-picker.compact .filter-row .form-control {
    padding: 3px 8px;
    font-size: inherit;
}

/* The glyph, its padding and its border have to stay inside `COMPACT_ICON_SIZE` in IconPicker.tsx. */
.icon-picker.compact .icon-list {
    --scroll-fade-top: 12px;
}

.icon-picker.compact .icon-list span {
    padding: 6px;
    font-size: 24px;
}

.icon-picker .icon-list span.bx-empty {
    width: unset;
}

.icon-picker .icon-list span.bx-empty::before {
    display: inline-block;
    content: "";
    border: 1px dashed var(--muted-text-color);
    width: 1em;
    height: 1em;
}

.icon-picker .no-results {
    padding: 20px;
    text-align: center;
    color: var(--muted-text-color);
}