Skip to content

Build your personal knowledge base with Trilium Notes

5.2 KB
Raw Blame
.calendar-view {
    overflow: hidden;
    position: relative;
    outline: 0;
    height: 100%;
    user-select: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;

    @media (max-width: 991px) {
        padding: 0 0 var(--content-margin-inline) 0;

        th {
            font-weight: normal;
            font-size: 0.9em;
        }
    }
}

.calendar-container {
    height: 100%;
}

/* Stacked beneath the title. Kept narrow so the overflow below has something to bite on. */
.calendar-view .calendar-event-attributes {
    min-width: 0;
}

/* A month cell's chip is a row, so the title is fallen beneath rather than followed down: the
   chip's own container is asked to wrap (see eventInnerClass) and the attributes claim a whole
   line of it. The inline padding is the one the row's title wears — Forma states it on the title
   rather than on the container — so that the two read as one column of text. */
.calendar-view .calendar-event-inner-wrapped {
    flex-wrap: wrap;

    > .calendar-event-attributes {
        flex-basis: 100%;
        padding-inline: 4px;
    }
}

.calendar-container .promoted-attribute {
    font-size: 0.85em;
    opacity: 0.85;
    overflow: hidden;
}

.calendar-view .collection-properties {
    .center-container {
        justify-content: center;

        .title {
            min-width: 150px;
            font-size: 1.2em;
            text-align: center;
        }
    }

    /* The end the view switcher stands at is the one asked to give where the bar is short: it holds
       a row that folds into a menu when it no longer fits (see CollapseOnOverflow), which is a
       better answer than either half of what happens otherwise — a flex item keeps its content's
       width unless told it may not, so the bar would grow past the pane rather than hand the
       switcher less, and the switcher would never learn that it was short. */
    .right-container {
        min-width: 0;
    }

    @media (max-width: 991px) {
        >div {
            justify-content: flex-start;
        }

        .right-container {
            flex-grow: 0;
        }

        .center-container {
            .title {
                flex-grow: 1;
                min-width: 110px;
                font-size: 0.95em;
            }
        }
    }
}

/* #region Events */

.calendar-view .calendar-event:hover {
    text-decoration: none;
}

/*
 * Forma draws a chip out of a single accent colour: a solid bar down its leading edge, and a 30%
 * tint of that same colour for the body. Trilium's chip is a pair rather than a derivation — a
 * black bar over a flat #eaeaea body — so the two are split. The accent is handed to the bar
 * through the palette's --fc-forma-event, and the body is stated here, on a class eventClass puts
 * on every chip.
 */
.calendar-view .calendar-event {
    background: var(--calendar-coll-event-background-color, var(--accented-background-color));

    /* Said outright, and so beyond the reach of the app-wide a:hover, the chip being an anchor. */
    color: var(--calendar-coll-event-text-color, var(--main-text-color));
}

/*
 * A note carrying a colour of its own says both: the bar takes the colour, the body a pale wash of
 * the same hue. Said as border-color rather than through --fc-event-color, which FullCalendar
 * writes inline on the chip and a stylesheet therefore cannot reach.
 */
.calendar-view .calendar-event.with-hue {
    border-color: var(--custom-color);
    color: var(--custom-color);
    background: hsl(var(--custom-color-hue),
                    var(--calendar-coll-event-background-saturation, 80%),
                    var(--calendar-coll-event-background-lightness, 95%));
}

/* Flat body and all, a chip still has to answer the pointer; Forma's own hover tint is what the
   rule above overrides. */
.calendar-view .calendar-event:hover {
    filter: var(--calendar-coll-event-hover-filter, none);
}

/* The shading a dragged range stands in, named by us rather than left to the theme's hashed class
   so the ghost can anchor to it; the colour is still Forma's, off the palette. */
.calendar-view .calendar-highlight {
    background-color: var(--fc-forma-highlight);
}

/* The note's icon, leading its title on the chip (see eventContent). */
.calendar-view .calendar-event-icon {
    margin-inline-end: .25em;
}

/* An archived note is faded and hatched, the stripes drawn behind its content. */
.calendar-view .calendar-event.archived {
    opacity: .65;
}

.calendar-view .calendar-event.archived::after {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    z-index: -1;

    --c1: transparent;
    --c2: var(--callendar-coll-event-archived-sripe-color, #00000013);

    background: repeating-linear-gradient(45deg, var(--c1), var(--c1) 8px,
                                          var(--c2) 8px, var(--c2) 16px);
}

/* The event the popover stands for, marked the way a focused event is. An outline rather than a
   border, the chip's only border being the bar down its leading edge. */
.calendar-view .calendar-event-selected {
    outline: 2px solid var(--custom-color, var(--input-focus-outline-color));
    outline-offset: -2px;
}

/* #endregion */