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.0 KB
Raw Blame
.InsightCard {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    height: 30rem;
    background: var(--color-bg-surface-primary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius);
    transition: border 200ms ease;

    &:has([data-bi-filter-status='unaffected']) {
        opacity: 0.3;
    }

    &--highlighted {
        border-color: var(--color-accent);
        outline: 1px solid var(--color-accent);
    }

    &--details-shown {
        z-index: var(--z-raised);
    }

    .ErrorBoundary {
        width: 100%;
        height: 100%;
        margin: auto;
    }
}

.InsightCard__viz {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0; // Allow flex item to shrink below content size (e.g. when description is toggled)
    overflow: auto;
    border-radius: 0 0 var(--radius) var(--radius);

    .LineGraph,
    .AnnotationsOverlay {
        padding: 0.5rem;
    }

    // Hog-charts doesn't need the legacy padding compensation — its canvas is
    // absolutely positioned, so the inherited overlay padding pushes badges
    // below the x-axis instead of aligning them.
    .HogChartsAnnotationsLayer .AnnotationsOverlay {
        padding: 0;
    }

    .LemonTable {
        background: none;
        border: none;
        border-radius: 0;
    }

    .WebAnalyticsDashboard .InsightVizDisplay & {
        min-height: var(--insight-viz-min-height);
    }

    // The Metric display bleeds its sparkline to the card edges (negative margins plus a
    // few-pixel downward shift so the line rests on the edge), so its content sits a hair
    // taller than the box. Clip it — otherwise `overflow: auto` shows a permanent vertical
    // scrollbar that overlaps the chart's rightmost points and blocks hover there.
    &--Metric {
        overflow: hidden;
    }
}

.InsightCard__vizInner {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}