Skip to content

Build your personal knowledge base with Trilium Notes

10.9 KB
Raw Blame
/*
 * MODALS
 */

/* Modal body */
.modal .modal-content {
    box-shadow: 0 .5em 3em .5em var(--modal-shadow-color);
    border: 1px solid var(--modal-border-color);
    background: var(--modal-background-color);
}

.modal .modal-header .modal-title {
    flex-grow: 1;
    font-size: 1.2em;
    color: var(--modal-title-color);
}

/* Modal footer */
.modal .modal-footer {
    background: var(--modal-footer-background);
    color: var(--modal-footer-color);
    border-top: unset;
}

/*
 * Footer buttons indicate focus on plain :focus (not only :focus-visible) so the
 * dialog's auto-focused default action (e.g. the OK button of a confirm dialog) shows a
 * ring even when the dialog was opened by mouse — programmatic focus after a pointer
 * interaction does not match :focus-visible.
 */
.modal .modal-footer button.btn:focus {
    outline: 2px solid var(--input-focus-outline-color);
}

/* Tool dialogs - small dialogs without a backdrop */
div.tn-tool-dialog {
    border-radius: 10px;
    background: var(--tool-dialog-background-color) !important;
    user-select: none;
    box-shadow: 10px 10px 93px -25px var(--tool-dialog-shadow-color);
}

/*
 * JUMP TO NOTE DIALOG
 */

 .jump-to-note-dialog .modal-dialog {
    --modal-background-color: var(--menu-background-color);
    --bs-modal-header-border-width: 0;

    backdrop-filter: var(--dropdown-backdrop-filter);
}

.jump-to-note-dialog .modal-content {
    --bs-modal-header-padding-x: 0;
    --jump-to-note-padding: 20px;
    --jump-to-note-fade: 20px;

    box-shadow: 0 10px 20px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
    border: 1px solid var(--dropdown-border-color);
    /* The results end the dialog, holding its bottom padding themselves. */
    padding: var(--jump-to-note-padding) var(--jump-to-note-padding) 0;
    border-radius: 8px;
}

.jump-to-note-dialog .modal-header {
    padding: unset !important;
    padding-bottom: calc(26px - var(--jump-to-note-fade)) !important;
}

.jump-to-note-dialog .modal-body {
    padding: 0 !important;
}

.jump-to-note-dialog .jump-to-note-results .note-suggestion-list {
    /* Auto, as a fixed width would shift with the negative margin rather than grow by it. */
    width: auto;
    margin-inline-end: calc(0px - var(--jump-to-note-padding));
    padding-inline-end: var(--jump-to-note-padding);
    --scroll-fade-top: var(--jump-to-note-fade);
    padding-top: var(--jump-to-note-fade);
    padding-bottom: var(--jump-to-note-padding);
    scroll-padding-bottom: var(--jump-to-note-padding);
    scroll-padding-top: var(--jump-to-note-fade);
}

/* Above the footer, the results fade out as they do under the search field. */
.jump-to-note-dialog .jump-to-note-results .note-suggestion-list:has(+ .note-suggestion-footer) {
    --scroll-fade-bottom: var(--jump-to-note-fade);
    padding-bottom: var(--jump-to-note-fade);
    scroll-padding-bottom: var(--jump-to-note-fade);
}

/*
 * Within the dialog's padding, so its ends line up with the search box and the close button. Its
 * top padding leaves a clear gap between the fade above and the controls.
 */
.jump-to-note-dialog .jump-to-note-results .note-suggestion-footer {
    padding: 12px 0 var(--jump-to-note-padding);
    border-top: 0;
}

/* Search box wrapper */
.jump-to-note-dialog .input-group {
    margin-inline-end: 16px;
}

.jump-to-note-dialog .input-group:hover {
    background: var(--quick-search-hover-background);
}

/* Focused search box */
.jump-to-note-dialog .input-group:focus-within {
    border-color: var(--quick-search-focus-border);
    background: var(--quick-search-focus-background);
    color: var(--quick-search-focus-color);
}

.jump-to-note-dialog .input-clearer-button {
    background: transparent !important;
}

/*
 * On the desktop the field is the dialog's heading, framed by the dialog itself: it holds the focus
 * for as long as the dialog is open, so a box and a focus ring around it say nothing. On mobile the
 * box stays, as the cue to tap.
 */
body.desktop .jump-to-note-dialog .input-group {
    &,
    &:hover,
    &:focus-within {
        background: transparent;
        border-color: transparent;
        outline: none;
    }

    .note-autocomplete-input {
        padding-inline-start: 0;
        font-size: 1.1rem;
    }

    /* Only while there is text to clear; hidden in place, so the field keeps its width. */
    .note-autocomplete-input:placeholder-shown ~ .input-clearer-button {
        visibility: hidden;
    }
}

/*
 * RECENT CHANGES DIALOG
 */

 .recent-changes-dialog .modal-body {
    padding: 0;
}

.recent-changes-content {
    margin: var(--bs-modal-padding);
}

/* Date headings */
.recent-changes-content > div > b {
    position: sticky;
    display: block;
    top: 0;
    background: var(--modal-background-color);
    padding: 10px 0 10px calc(var(--timeline-left-gap) + var(--timeline-right-gap));
    font-size: 1.25em;
    font-weight: 300;
    z-index: 10;
}

.recent-changes-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Timeline items */
.recent-changes-content ul li {
    display: flex;
    position: relative;
    margin: 0;
    border: unset;
    padding-top: var(--timeline-item-top-padding);
    padding-bottom: var(--timeline-item-bottom-padding);
    padding-inline-start: calc(var(--timeline-left-gap) + var(--timeline-right-gap));
    padding-inline-end: var(--timeline-left-gap);
    color: var(--active-item-text-color);
}

.recent-changes-content li > span:first-child::after {
    /* Remove the dash between time and note title */
    content: "" !important;
}

.recent-changes-content ul li:not(.deleted-note):hover {
    border-radius: 8px;
    background: var(--hover-item-background-color);
    color: var(--hover-item-text-color);
}

.recent-changes-content ul li .note-path {
    color: var(--muted-text-color);
    font-size: 0.75em;
}

/* Item time */
.recent-changes-content ul li > span:first-child {
    display: inline-block;
    min-width: 80px;
    vertical-align: top;
    color: var(--muted-text-color);
}

/* Item title & path container */
.recent-changes-content ul li > span:not(:first-child) {
    display: inline-block;
}

/* Item title link */

.recent-changes-content ul li a {
    color: currentColor;
}

.recent-changes-content ul li a:hover {
    text-decoration: underline;
}

/* Item title for deleted notes */
.recent-changes-dialog-view-mode-all-changes  ul li.deleted-note .note-title {
    text-decoration: line-through;
}

/* Item path */
.recent-changes-content ul li > span:not(:first-child) small {
    display: block;
    line-height: 1;
    opacity: 0.75;
}

/* Timeline connector */
.recent-changes-content ul li::before,
.recent-changes-content > div > b::before {
    position: absolute;
    content: "";
    top: var(--connector-top, 0);
    inset-inline-start: calc(var(--timeline-left-gap) + ((var(--timeline-bullet-size) - var(--timeline-connector-size)) / 2));
    bottom: var(--connector-bottom, 0);
    width: var(--timeline-connector-size);
    border-radius: var(--connector-radius, 0) var(--connector-radius, 0) 0 0;
    background: var(--timeline-connector-color);
    transition: background-color 400ms ease-in-out;
}

.recent-changes-content ul li:hover:before {
    mix-blend-mode: var(--timeline-connector-hover-blend-mode);
}

.recent-changes-content > div:hover {
    --timeline-connector-color: var(--timeline-connector-active-color);
}

/* The first item of the timeline */
.recent-changes-content > div:first-child > b:first-child {
    --connector-top: 50%;
    --connector-radius: calc(var(--timeline-connector-size) / 2);
}

/* The last item of the timeline */
.recent-changes-content > div:last-child li:last-child {
    --connector-bottom: 50%;
}

/* Timeline bullet */
.recent-changes-content ul li::after {
    position: absolute;
    content: "";
    top: calc(var(--timeline-item-top-padding) + var(--timeline-bullet-vertical-pos));
    inset-inline-start: var(--timeline-left-gap);
    width: var(--timeline-bullet-size);
    height: var(--timeline-bullet-size);
    border-radius: 50%;
    background: var(--timeline-bullet-color);
    transform: translateY(-50%);
}

/* Hovered timeline bullet */
.recent-changes-content ul li:hover::after {
    background: var(--timeline-bullet-hover-color);
}

/*
 * CHEATSHEET DIALOG
 */

 .help-dialog .modal-content {
    --modal-background-color: var(--help-background-color);
    backdrop-filter: blur(var(--help-backdrop-blur));
}

.help-dialog .help-cards {
    display: block;
    columns: 3;
    column-gap: 20px;
}

.help-dialog .card {
    margin: 0;
    width: auto;
    border: none;
    background: unset;
    padding: 16px 8px;
    break-inside: avoid-column;
}

.help-dialog .card-body {
    box-shadow: var(--help-card-shadow);
    border-radius: 6px;
    background: var(--help-card-background);
}

.help-dialog .card-body h5,
.help-dialog .card-body h6 {
    color: var(--help-card-heading-color);
    font-weight: 600;
}

.help-dialog .card-body h5 {
    font-size: 20px;
}

.help-dialog .card-body h6 {
    font-size: 15px;
    padding-bottom: 0.5em;
}

/* Help card item */
.help-dialog .help-cards ul {
    list-style-type: none;
    padding: 0;
}

.help-dialog .help-cards li:not(:first-child) {
    margin-top: 0.4em;
}

/* Keyboard shortcut. Tooltips have their own palette — see the TOOLTIPS section in base.css.
   `:where(:not(.excalidraw *))` leaves out the menus of an embedded canvas drawing. */
.help-dialog .help-cards kbd,
.ck-content kbd:where(:not(.excalidraw *)) {
    display: inline-block;
    margin: 0 2px 2px !important;
    border: 1px solid var(--help-kbd-shortcut-border);
    border-radius: 5px;
    padding: 2px 8px;
    background: var(--help-kbd-shortcut-background);
    box-shadow:
        0 2px 0 var(--help-kbd-shortcut-border),
        inset 0 -1px 0 var(--help-kbd-shortcut-border);
    color: var(--help-kbd-shortcut-color);
    font-family: var(--main-font-family) !important;
    font-size: 0.75em;
    font-weight: normal;
    line-height: 1.4;
    letter-spacing: 0.5pt;
    vertical-align: 1px;
    white-space: nowrap;
}

.help-dialog .help-cards kbd:first-child {
    margin-inline-start: 0;
}

/* Inline code - used for Markdown samples */
.help-dialog .help-cards code {
    border-radius: 4px;
    background: var(--help-code-background);
    padding: 0 8px;
    color: var(--help-code-color);
}

/* DELETE NOTE PREVIEW DIALOG */

.delete-notes-list .note-path {
    padding-inline-start: 8px;
    color: var(--muted-text-color)
}

/*
 * ATTRIBUTE DETAIL DIALOG
 */

/* Labels */
.attr-edit-table th {
    padding-inline-end: 12px;
    font-weight: normal;
    white-space: nowrap;
}

/*
 * NOTE TYPE CHOOSER DIALOG
 */

/* :focus, not :focus-visible, so the pointer and keyboard paths match. The :hover selector keeps
   style.css from tinting the focused row, which it does to anything hovered that is not .active. */
:root .note-type-chooser-dialog .dropdown-item:focus,
:root .note-type-chooser-dialog .dropdown-item:focus:hover {
    outline: 2px solid var(--input-focus-outline-color) !important;
    outline-offset: -2px;
    background-color: var(--active-item-background-color) !important;
}