Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

2.2 KB
Raw Blame
.ExportedInsight {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    background: var(--color-bg-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius);

    .ExportedInsight__header {
        display: flex;
        justify-content: space-between;
        padding: 1rem;
        border-bottom: 1px solid var(--color-border-primary);

        .ExportedInsight__header__title {
            font-size: 1rem;
            font-weight: 600;
        }
    }

    .ExportedInsight__content {
        position: relative;
        z-index: 1;
        display: flex;
        flex: 1;
        flex-direction: column;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    // A metric renders as a dashboard-tile-like card — header plus chart band — rather than stretched to
    // the full exporter height. The ratio sits on the band, not the card, so a tall header (a long
    // description wrapping over several lines) grows the card instead of squeezing the chart to a sliver.
    &--metric {
        flex: 0 0 auto;
        height: auto;

        .ExportedInsight__content {
            flex: 0 0 auto;
            aspect-ratio: 2 / 1;
        }

        // The quill sparkline shifts itself down 6px (`top-[6px]`) so its zero-baseline — drawn 6px
        // above the canvas bottom, inside the hover-ring margin — rests exactly on the card's bottom
        // edge. But an ancestor clips at that edge, so the 2px baseline stroke straddles the clip line
        // and can all but vanish depending on sub-pixel flex heights. Ease the shift by 2px so the
        // whole stroke stays inside the card, still visually hugging the bottom. A transform (rather
        // than overriding `top`) sidesteps the `!important` on the tailwind utility.
        [data-attr='metric-sparkline'] {
            transform: translateY(-2px);
        }
    }

    .LemonTable {
        --lemon-table-background-color: var(--color-bg-surface-primary);
    }

    .ExportedInsight__watermark {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 2;

        svg {
            margin: 0.25rem;
        }
    }
}