Skip to main content

MOBILE_TAB_BAR_STYLES

Constant MOBILE_TAB_BAR_STYLES 

Source
pub const MOBILE_TAB_BAR_STYLES: &str = r#"
/* Mobile Tab Bar Container */
.mobile-tabs {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        gap: 4px;
        padding: 8px var(--mobile-padding, 12px);
        background: rgba(0, 0, 0, 0.4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Individual Tab Button */
    .mobile-tab {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        border: none;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.05);
        color: #888;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-height: var(--touch-min, 44px);
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tab-icon {
        font-size: 18px;
        line-height: 1;
    }

    .mobile-tab-label {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .mobile-tab:active {
        background: rgba(255, 255, 255, 0.15);
        transform: scale(0.97);
    }

    .mobile-tab.active {
        background: rgba(102, 126, 234, 0.25);
        color: #e8e8e8;
        border: 1px solid rgba(102, 126, 234, 0.4);
    }

    /* Tab indicator dots (optional, for swipe hint) */
    .mobile-tab-indicator {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 6px;
        background: rgba(0, 0, 0, 0.2);
    }

    .mobile-tab-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transition: all 0.2s ease;
    }

    .mobile-tab-dot.active {
        background: #667eea;
        width: 18px;
        border-radius: 3px;
    }
}

/* Landscape mobile - horizontal tab layout */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-tabs {
        padding: 4px 8px;
    }

    .mobile-tab {
        padding: 6px 12px;
        flex-direction: row;
        gap: 6px;
        min-height: 36px;
    }

    .mobile-tab-icon {
        font-size: 16px;
    }
}
"#;
Expand description

Reusable mobile tab bar styles - use for any tabbed interface on mobile