Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

8.6 KB
Raw Blame
// ============================================
// MAIN CONTENT LAYOUT
// ============================================

.dashboard-layout {
    --sk-statusbar-height: 30px;
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: $sidebar-width;
    flex: 1;
    min-width: 0;
    padding: $space-10;
    overflow-y: auto;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;

    @media (max-width: $breakpoint-md) {
        margin-left: 0;
        // Clear the fixed mobile header (plus the notch inset, if any).
        padding: calc(#{$mobile-header-height} + env(safe-area-inset-top) + #{$space-5}) $space-5 $space-5;
    }

    // Remove padding for routed tool surfaces that manage their own layout.
    &--full-page,
    &:has(.workflow-page.fullscreen),
    &:has(.page-container--full-bleed) {
        padding: 0;
        overflow: hidden;
        height: 100vh;

        // Full-bleed tools still sit below the fixed mobile header.
        @media (max-width: $breakpoint-md) {
            height: calc(100dvh - #{$mobile-header-height} - env(safe-area-inset-top));
            margin-top: calc(#{$mobile-header-height} + env(safe-area-inset-top));
        }
    }
}

// Top bar (page header)
.top-bar {
    @include flex-between();
    margin-bottom: $space-10;
    padding-bottom: $space-4;
    border-bottom: 1px solid $border-subtle;

    h1 {
        font-size: $text-xl;
        font-weight: $font-weight-semibold;
        letter-spacing: -0.5px;
    }

    @media (max-width: $breakpoint-md) {
        flex-direction: column;
        gap: $space-4;
    }
}

.top-bar-actions {
    display: flex;
    gap: $space-3;
}

// Shared Page Wrapper
.page-container {
    // Full width like every page body (Dashboard, Server detail).
    width: 100%;
    padding-bottom: $space-10;

    &--full-bleed {
        max-width: none;
        margin: 0;
        padding-bottom: 0;
    }
}

// ============================================================
// PAGE SHELL
// The one frame every page gets, in two flavours:
//   .sk-pageshell — a standalone page   (layouts/PageLayout.jsx)
//   .sk-tabgroup  — a routed tab group  (layouts/TabGroupLayout.jsx)
// Both are full-bleed so the top bar pins flush to the top of the content
// region and the body scrolls beneath it. A page should never hand-roll this:
// dropping a `.sk-topbar` into the default padded `.page-container` leaves the
// bar floating in the well with a gutter on every side.
// ============================================================
@mixin page-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;

    > .sk-topbar {
        flex-shrink: 0;
        padding: $space-3 $space-4;
        margin: 0;

        // Match the 18px header icon the per-page top bars used to render.
        .sk-topbar__ico svg { width: 18px; height: 18px; }

        @media (max-width: $breakpoint-md) { padding: 10px $space-3; }
    }
}

// Scroll region below the bar.
@mixin page-shell-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

// Centered body: the reading column every ordinary page sits in.
// Full width on every page (lists, dashboards, detail pages alike) with one
// gutter; a form that needs a reading width caps its own column (Settings).
@mixin page-shell-inner {
    width: 100%;
    // One gutter on every side for every page body; page roots inside add no
    // padding of their own, so content starts at the same spot everywhere.
    padding: $space-5 $space-5 $space-8;

    @media (max-width: $breakpoint-md) { padding: $space-4 $space-4 $space-8; }
}

// Standalone pages (Cron Jobs, Settings, Documentation, …).
// NOT `.sk-page` — components/PageSkeleton.jsx already owns that name for its
// loading archetypes, and its `gap: 16px` leaked in as a band of page
// background between the top bar and the content on every shell page.
.sk-pageshell {
    @include page-shell;

    &__content {
        @include page-shell-content;

        // `fill` bodies (terminals, consoles, trees) take the whole region and
        // manage their own scroll instead of riding the centered column.
        > .sk-pageshell__fill { flex: 1; min-height: 0; }
    }

    &__inner { @include page-shell-inner; }
}

// Tab group shell (Servers / Domains-style route groups). A parent layout
// renders the PageTopbar + routed sub-nav once and swaps only the content
// below, so switching tabs feels like real tabs instead of a full-page
// remount — and the header never shifts between tabs.
.sk-tabgroup {
    @include page-shell;

    &__content {
        @include page-shell-content;

        // Full-bleed pages (File Manager) fill the region edge-to-edge and
        // manage their own internal scroll. Centered pages instead wrap their
        // content in .sk-tabgroup__inner (below). The Servers ops workspace
        // used to opt in here; it is a plain centered list now.
        > .sk-tabgroup__fill { flex: 1; min-height: 0; }
    }

    // Centered pages (Agent Fleet, Fleet Monitor, Cloud Servers, Config
    // Templates) keep their max-width framing inside the full-bleed shell.
    &__inner { @include page-shell-inner; }
}

// REMOVED: `.page-header` (the old <div class="page-header"><h1>…</h1></div>
// block). Every page now gets its bar from PageTopbar — either titleless via
// TabGroupLayout (the default) or titled for standalone/entity pages. Bespoke
// workspace pages (Docker, Database Explorer) carry no page bar by design.
// See pages/StyleGuide.jsx → "Page Headers". Don't reintroduce this class.

// .page is a legacy alias for .page-container — kept for any stragglers, no styling.
// New pages should use .page-container directly.

// Loading state (full-page spinner)

// Route-level loading (within dashboard)

// ============================================================
// APP-LEVEL INITIAL LOADER
// Full-screen splash shown while auth/setup state resolves.
// ============================================================
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: $space-4;
    background: var(--surface);

    // Branded tile holding the server glyph — same mark as the sidebar + favicon.
    &__logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 76px;
        height: 76px;
        border-radius: $radius-overlay;
        color: #fff;
        background: linear-gradient(150deg, var(--accent-bright), var(--accent-hover));
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10); // geometry: inset 1px rim used as a border
        animation: app-loader-breathe 2.6s ease-in-out infinite;
    }

    &__glyph {
        width: 42px;
        height: 42px; // geometry: icon size
    }

    // Status LEDs blink like a booting machine; the lower one is "online" green.
    &__led {
        animation: app-loader-blink 1.4s ease-in-out infinite;

        &--2 {
            stroke: var(--green);
            animation-delay: 0.55s;
        }
    }

    // Slim indeterminate bar replaces the old spinner.
    &__bar {
        position: relative;
        width: 132px;
        height: 4px;
        border-radius: $radius-full;
        background: var(--surface-3);
        overflow: hidden;
    }

    &__bar-fill {
        position: absolute;
        top: 0;
        left: 0;
        width: 40%;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, transparent, var(--accent-bright), transparent);
        animation: app-loader-slide 1.3s ease-in-out infinite;
    }

    &__label {
        font-size: $text-xs;
        font-weight: $font-weight-medium;
        color: var(--text-dim);
    }
}

@keyframes app-loader-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.025); }
}

@keyframes app-loader-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

@keyframes app-loader-slide {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(330%); }
}

// Respect reduced-motion: hold everything still, keep the bar visible.
@media (prefers-reduced-motion: reduce) {
    .app-loader__logo,
    .app-loader__led,
    .app-loader__bar-fill {
        animation: none;
    }

    .app-loader__bar-fill {
        width: 100%;
    }
}

// Skeletons already provide their own page spacing.
.sk-tabgroup__inner,
.page-container {
    > .empty-state--loading:has(.sk-page-wrap) {
        padding: 0;
    }
}