Skip to content

Build your personal knowledge base with Trilium Notes

2.6 KB
Raw Blame
/*
 * An island in the trailing corner rather than a wall against the edge: everything else over this
 * map is one, and the map is a widget inside a note rather than a screen of its own, so a pane flush
 * to its edge reads as cropping it.
 *
 * The width must agree with `PANE_WIDTH` in DetailPane.tsx.
 */
.geo-map-container {
    --geo-detail-pane-width: 380px;
}

.geo-map-container .geo-detail-pane {
    position: absolute;
    /* A fixed height rather than one sized to its contents, which would be a different pane for
       every marker. What it holds scrolls within it (see OverlayPanel.css). It stands clear of the
       bar of buttons in this same corner rather than moving it aside — the mind map's panel reckons
       its foot the same way. */
    top: var(--geo-map-inset-top);
    bottom: var(--geo-map-foot);
    inset-inline-end: var(--geo-map-inset-end);
    width: var(--geo-detail-pane-width);
    /* An embedded map may be narrower than the pane would like to be — and in fullscreen the sides
       are not equally free, so each is taken off by its own name rather than one of them twice. */
    max-width: calc(100% - var(--geo-map-inset-start) - var(--geo-map-inset-end));

    /* Grown over the map (see the maximize in `EmbeddedNoteSurface`). Only the width gives: the pane
       already stands the height of the map. What the map places around the pane is suppressed
       while it is grown rather than recomputed — see `maximized` in DetailPane.tsx. */
    &.maximized {
        width: calc(100% - var(--geo-map-inset-start) - var(--geo-map-inset-end));
    }
    /* Clear of MapLibre's own control corners, which sit at 2 (see MapToolbar.css). */
    z-index: 3;
}

/*
 * Where the marker stands, reading as a subtitle to the name above it rather than as one more thing
 * to press: it is a line of text that happens to answer to a click, so it stands on no plate of its
 * own until it is aimed at.
 */
.geo-map-container .geo-detail-pane .geo-detail-pane-location,
.geo-map-container .geo-place-panel .geo-detail-pane-location,
.modal.geo-detail-sheet .geo-detail-pane-location {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    /* Room to be pressed, taken back at the leading edge so the text still lines up with the button
       row under it. */
    margin-inline-start: -6px;
    padding: 2px 6px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--muted-text-color);
    font-size: 0.85em;

    &:hover {
        background: var(--hover-item-background-color);
        color: var(--main-text-color);
    }
}