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.

3.2 KB
Raw Blame
.LemonTabs {
    --lemon-tabs-margin-bottom: 1rem;
    --lemon-tabs-content-padding: 0.75rem 0;

    position: relative;
    display: flex;
    flex-direction: column;
    align-self: stretch;

    &--small {
        --lemon-tabs-margin-bottom: 0.5rem;
        --lemon-tabs-content-padding: 0.375rem 0;
    }

    &--xsmall {
        --lemon-tabs-margin-bottom: 0.25rem;
        --lemon-tabs-content-padding: 0.25rem 0;

        font-size: 0.8125rem;

        .LemonTabs__bar {
            overflow-x: clip; // Prevent scrollbar from slider positioning
        }
    }

    .Navigation3000__scene > &:first-child,
    .Navigation3000__scene > :first-child > &:first-child {
        margin-top: -0.75rem;
    }
}

.LemonTabs__bar {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: stretch;
    justify-content: space-between;
    margin-bottom: var(--lemon-tabs-margin-bottom);
    overflow-x: auto;
    list-style: none;

    &::before {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;

        // The bottom border
        content: '';
        background: var(--color-border-primary);
    }

    &::after {
        position: absolute;
        bottom: 0;
        left: 0;
        width: var(--lemon-tabs-slider-width);
        height: 0.125rem;

        // The active tab slider
        content: '';
        background: var(--color-accent);
        transform: translateX(var(--lemon-tabs-slider-offset));

        .LemonTabs--transitioning & {
            transition:
                width 150ms ease,
                transform 150ms ease;
        }
    }

    .LemonTabs__tab {
        color: var(--color-text-tertiary);

        .LemonTabs--transitioning & {
            transition: color 150ms ease;
        }

        &:hover {
            color: var(--color-text-primary);
        }

        &:active {
            color: var(--color-text-primary);
        }

        &:not(:hover) .LemonTag {
            color: var(--color-text-tertiary);
        }

        &.LemonTabs__tab--disabled {
            color: var(--color-text-tertiary);
            opacity: 0.5;

            &:hover,
            &:active {
                color: var(--color-text-tertiary);
            }

            .LemonTabs__tab-content {
                cursor: not-allowed;
            }
        }

        &.LemonTabs__tab--active {
            color: var(--color-accent);
            text-shadow: 0 0 0.25px currentColor; // Simulate increased weight without affecting width

            .LemonTag {
                color: var(--color-accent);
                border-color: var(--color-accent);
            }
        }

        a {
            color: inherit;

            // Make tab labels that are links the same colors as regular tab labels
            text-decoration: none;
            transition: none;
        }

        &[aria-selected='true'] {
            color: var(--color-accent);

            div,
            a {
                color: var(--color-accent);
            }
        }

        .LemonTabs__tab-content {
            display: flex;
            align-items: center;
            padding: var(--lemon-tabs-content-padding);
            white-space: nowrap;
            cursor: pointer;
        }
    }
}