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.

9.0 KB
Raw Blame
// ============================================
// STYLE GUIDE - Dev-only reference page
// ============================================

.styleguide {
    // The guide uses the same semantic SCSS contract it demonstrates. Dynamic
    // token values (swatch colours, spacing widths) stay on their preview node.
    &__section > * + * { margin-top: $space-6; }
    &__examples > * + * { margin-top: $space-4; }
    &__examples--compact > * + * { margin-top: $space-2; }

    &__demo-card {
        padding: $space-6;

        &--flush { padding: 0; overflow: hidden; }
        &--interactive { text-align: center; cursor: pointer; }
    }

    &__swatch-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: $space-3;
        padding: $space-5;
    }

    &__font-sample { font-family: $font-main; margin-bottom: $space-4; }
    &__code-sample { font-family: $font-mono; font-size: $text-base; }
    &__code-sample code { font: inherit; }
    &__weight-sample { margin-bottom: $space-2; }

    &__token-row {
        display: flex;
        align-items: center;
        gap: $space-4;
        margin-bottom: $space-2;

        &--spacing { margin-bottom: $space-3; }
    }

    &__token-name {
        font-family: $font-mono;
        font-size: $text-xs;
        color: $text-tertiary;

        &--font { min-width: 160px; }
        &--spacing { min-width: 120px; }
        &--layout { min-width: 180px; }
    }

    &__token-value {
        min-width: 50px;
        font-family: $font-mono;
        font-size: $text-xs;
        color: $text-secondary;
    }

    &__description {
        font-size: $text-base;
        color: $text-secondary;

        &--muted { color: $text-tertiary; }
        &--mono { font-family: $font-mono; }
        &--spaced { margin-bottom: $space-2; }
        &--section-end { margin-bottom: $space-4; }
    }

    &__actions {
        display: flex;
        flex-wrap: wrap;
        gap: $space-3;

        &--aligned { align-items: center; }
        &--spaced { margin-bottom: $space-4; }
        &--section-end { margin-bottom: $space-6; }
    }

    &__full-width-button { width: 100%; margin-bottom: $space-4; }
    &__progress-value { font-size: $text-base; }
    &__progress-labels { display: flex; justify-content: space-between; margin-bottom: $space-1; }
    &__modal-field { margin-top: $space-4; }
    &__drawer-fields {
        padding: $space-4 0;
        > * + * { margin-top: $space-4; }
    }
    &__tab-content { padding-top: $space-4; color: $text-secondary; }

    &__spinner-row { display: flex; align-items: center; gap: $space-6; }
    &__spinner-example { display: flex; flex-direction: column; align-items: center; gap: $space-2; }
    &__comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: $space-4; }
    &__scan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: $space-4; }
    &__scan-icon { display: flex; justify-content: center; margin-bottom: $space-3; }
    &__scan-title { margin-bottom: $space-1; }
    &__log-example { height: 360px; }
    &__journal-example { height: 160px; }

    &__flex-example {
        display: flex;
        align-items: center;
        gap: $space-3;
        margin-bottom: $space-4;
        padding: $space-2;
        border: 1px dashed var(--border-active);

        &--spread { align-items: normal; justify-content: space-between; gap: normal; }
        &--stack {
            flex-direction: column;
            align-items: normal;
            gap: $space-2;
            max-width: 200px;
            margin-bottom: 0;
        }
    }
    &__layout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: $space-3; }
    &__swatch-text { font-size: $text-base; font-weight: $font-weight-semibold; }

    // Nav tabs for sections
    &__nav {
        display: flex;
        flex-wrap: wrap;
        gap: $space-2;
        margin-bottom: $space-6;
        padding-bottom: $space-4;
        border-bottom: 1px solid $border-default;
    }

    &__nav-btn {
        display: inline-flex;
        align-items: center;
        gap: $space-2;
        padding: $space-2 $space-3;
        font-size: $text-xs;
        font-weight: $font-weight-medium;
        color: $text-tertiary;
        background: transparent;
        border: 1px solid transparent;
        border-radius: $radius-control;
        cursor: pointer;
        transition: all $transition-fast;

        &:hover {
            color: $text-primary;
            background: $bg-hover;
        }

        &.active {
            color: $accent-primary;
            background: $accent-glow;
            border-color: $accent-primary;
        }
    }

    &__content {
        min-height: 400px;
    }

    &__section-title {
        font-size: $text-lg;
        font-weight: $font-weight-semibold;
        color: $text-primary;
        margin-bottom: $space-3;
        padding-bottom: $space-2;
        border-bottom: 1px solid $border-subtle;
    }

    // Color swatches
    &__swatch-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: $space-3;
    }

    &__swatch {
        display: flex;
        flex-direction: column;
        gap: $space-1;
    }

    &__swatch-preview {
        width: 100%;
        height: 64px;
        border-radius: $radius-card;
        border: 1px solid $border-default;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    &__swatch-label {
        font-size: $text-xs;
        font-weight: $font-weight-medium;
        color: $text-primary;
    }

    &__swatch-token {
        font-family: $font-mono;
        font-size: $text-xs;
        color: $text-tertiary;
    }

    // Spacing bars
    &__spacing-bar {
        height: $space-4;
        background: $accent-primary;
        border-radius: $radius-badge;
        min-width: 4px;
    }

    // Radius preview boxes
    &__radius-box {
        width: 64px;
        height: 64px;
        background: $accent-glow;
        border: 2px solid $accent-primary;
    }

    // Shadow preview boxes
    &__shadow-box {
        width: 80px;
        height: 80px;
        background: $bg-card;
        border-radius: $radius-card;
        border: 1px solid $border-default;
    }

    // Utility demo boxes
    &__util-box {
        padding: $space-2 $space-3;
        background: $bg-elevated;
        border: 1px solid $border-default;
        border-radius: $radius-control;
        font-size: $text-xs;
        color: $text-secondary;
        text-align: center;
    }

    &__split-demo {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: $space-4;

        @media (max-width: $breakpoint-lg) {
            grid-template-columns: 1fr;
        }
    }

    // Controls tab (components/styleguide/ControlsShowcase.jsx).
    &__controls {
        display: flex;
        flex-direction: column;
        gap: $space-4;
    }

    &__control-demo {
        display: flex;
        flex-direction: column;
        gap: $space-4;
        padding: $space-5;
        background: $bg-card;
        border: 1px solid $border-subtle;
        border-radius: $radius-card;
    }

    &__control-head {
        h3 {
            margin: 0;
            font-size: $text-md;
            font-weight: $font-weight-semibold;
        }

        p {
            margin: $space-1 0 0;
            max-width: 72ch;
            color: $text-secondary;
            font-size: $text-sm;
        }
    }

    &__control-body {
        display: flex;
        flex-direction: column;
        gap: $space-4;

        .form-field { margin-bottom: 0; }
    }

    &__control-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: $space-2;

        &--top { align-items: flex-start; gap: $space-8; }
    }

    &__control-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
        gap: $space-4;
    }

    &__control-stack {
        display: flex;
        flex-direction: column;
        gap: $space-4;
        max-width: 36rem;
    }

    &__control-state {
        display: flex;
        flex-direction: column;
        gap: $space-tight;
    }

    &__control-state-label {
        color: $text-secondary;
        font-size: $text-xs;
    }

    &__control-split {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: $space-6;

        @media (max-width: $breakpoint-lg) { grid-template-columns: 1fr; }
    }

    &__control-calendar {
        display: flex;
        flex-wrap: wrap;
        gap: $space-8;
        padding: $space-4;
        border: 1px solid $border-subtle;
        border-radius: $radius-card;
        background: $bg-elevated;
        width: fit-content;
    }

    &__control-tree {
        max-width: 26rem;
        border: 1px solid $border-subtle;
        border-radius: $radius-card;
        background: $bg-body;
    }

    &__control-tip-wrap { display: inline-flex; }

    &__control-ok {
        margin: 0;
        color: $success;
        font-size: $text-sm;
    }
}