Skip to content

Build your personal knowledge base with Trilium Notes

2.5 KB
Raw Blame
.dropdown-item {
    .description {
        font-size: small;
        color: var(--muted-text-color);
        white-space: normal;
    }

    span.tn-icon {
        flex-shrink: 0;
    }

    & > span > div:has(> .switch-widget) {
        flex-grow: 1;
    }

    .switch-widget {
        flex-grow: 1;
        width: 100%;
        --switch-track-width: 40px;
        --switch-track-height: 20px;
        --switch-thumb-width: 12px;
        --switch-thumb-height: var(--switch-thumb-width);

        .contextual-help {
            margin-inline-start: 0.25em;
            cursor: pointer;
        }

        .switch-spacer {
            flex-grow: 1;
        }
    }
}

/* Ends the switch where a submenu row's arrow ends (see `.dropdown-submenu .dropdown-toggle::after`
   below), rather than at the padding kept for that arrow. */
.dropdown-item.tn-menu-toggle {
    --menu-item-end-padding: 10px;
}

.form-list-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;

    .form-list-col {
        flex-grow: 1;
    }
}

.dropdown-header.tn-menu-header-with-actions {
    display: flex;
    align-items: center;
    gap: 1em;

    > .tn-menu-header-actions {
        --icon-button-size: 22px;
        --icon-button-color: var(--menu-item-icon-color);

        display: flex;
        align-items: center;
        gap: 2px;
        margin-inline: auto -4px;
        /* The buttons overflow the line evenly, so the heading keeps its height. */
        height: 0;
        letter-spacing: normal;

        .icon-action {
            padding: 0;
            width: var(--icon-button-size);
            height: var(--icon-button-size);
            font-size: calc(var(--icon-button-size) * 0.65);
        }
    }
}

body.mobile .dropdown-submenu .dropdown-toggle::after,
body.desktop .dropdown-submenu .dropdown-toggle::after {
    content: "\ed3b" !important;
    position: absolute;
    display: flex !important;
    align-items: center;
    justify-content: center;
    top: 0;
    height: 100%;
    inset-inline-end: 0;
    margin: unset !important;
    border: unset !important;
    padding: 0 4px;
    font-family: boxicons;
    font-size: 1.2em;
    color: var(--menu-item-arrow-color) !important;
}

/* Right to left, the end side is the left, so the arrow points the other way. */
body[dir=rtl] .dropdown-submenu .dropdown-toggle::after {
    content: "\ea4d" !important;
}

/* The width of the arrow's box. The Next theme sets its own padding on the row and the toggle. */
.dropdown-item.dropdown-submenu {
    padding-inline-end: calc(1.2em + 8px);
}