Skip to content

Build your personal knowledge base with Trilium Notes

2.2 KB
Raw Blame
.edit-link-balloon {
    padding: 8px;
    /* Keeps the card wider than the 500px at which Card.css stacks its rows. */
    width: 34rem;
    max-width: calc(100vw - 2rem);
    /* Overrides the text styles inherited from CKEditor's `ck-reset_all`. */
    font-size: var(--main-font-size);
    line-height: var(--bs-body-line-height);
    white-space: normal;
    text-align: start;

    .edit-link-targets {
        margin-bottom: 8px;
    }

    .edit-link-actions {
        display: flex;
        justify-content: flex-end;
    }
}

:is(.modal.edit-link-dialog, .edit-link-balloon) {
    .tn-card {
        margin-bottom: 1rem;
    }

    .tn-card:last-child {
        margin-bottom: 0;
    }

    /* Matches the 500px at which Card.css stacks a wide control under its label. */
    @container (min-width: 501px) {
        :is(.edit-link-note, .edit-link-url, .edit-link-text, .edit-link-description) {
            --edit-link-label-width: 8em;

            > .tn-card-option-label {
                flex: 0 0 var(--edit-link-label-width);
                min-width: max-content;
            }

            > :is(.form-control, .input-group) {
                flex: 1 1 auto;
                min-width: 0;
            }
        }
    }

    .edit-link-description textarea {
        resize: none;
    }

    .edit-link-target {
        display: flex;
        width: fit-content;
        margin: 0 auto 1rem;
    }

    .edit-link-targets {
        max-height: 240px;
        overflow-y: auto;

        .tn-card-choice {
            .tn-icon {
                color: var(--menu-item-icon-color);
            }

            &[aria-checked="true"] {
                background-color: var(--low-profile-button-active-background-color);
                color: var(--low-profile-button-active-color);

                .tn-icon {
                    color: inherit;
                }
            }

            &:focus-visible {
                outline-offset: -2px;
            }
        }
    }

    .edit-link-headings {
        --card-nested-section-indent: 24px;

        .tn-card-choice-label {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }
}