mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-06 15:12:30 +09:00
refactor(styles): promote .sk-state primitive + final design-system sweeps
(1) New %sk-state placeholder + .sk-state class in _design-system.scss (mono uppercase state chip, 7 tone modifiers); the 5 page-local copies (.mon-state/.sec-state/.inc-state+.inc-impact/.git-chip/.bk-type) now @extend it - class names and JSX untouched, compiled output verified equivalent. (2) Dead connectionColors export removed from connectionRules.js (zero consumers). (3) _email.scss globals evicted: .status-badge deleted (its unique content was dead variants + a phantom ::before dot artifact in two text badges - strict improvement), .empty-state moved to _empty-state.scss via an html-prefixed bridge that preserves the cascade over page-partial copies. (4) TokenModal blocks in _servers.scss re-tokened (--bg-code scripts/connection string, eyebrow labels, green status dot) - no other selectors in the file changed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b1e9849ab
commit
6f5df6db6e
10 files changed
+114
-144
No files matched your search
@@ -36,6 +36,41 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
|
||||
&--gray { background: var(--surface-3); color: var(--text-faint); .sk-pill__dot { background: var(--text-faint); } }
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// State chip — mono uppercase micro-label on a semantic wash
|
||||
// (alert/incident states, severities, kind/type tags). One source of
|
||||
// truth for the shape: page-local chip classes (.mon-state, .sec-state,
|
||||
// .inc-state/.inc-impact, .git-chip, .bk-type) keep their names and
|
||||
// `@extend %sk-state;`, layering their own tone modifiers / sizing
|
||||
// deviations on top. New consumers use `.sk-state` directly (style
|
||||
// class like .sk-dtable, no ds/ component).
|
||||
// ------------------------------------------------------------
|
||||
%sk-state {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 3px 9px;
|
||||
border-radius: 6px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sk-state {
|
||||
@extend %sk-state;
|
||||
|
||||
&--red { color: var(--red); background: var(--red-bg); }
|
||||
&--amber { color: var(--amber); background: var(--amber-bg); }
|
||||
&--green { color: var(--green); background: var(--green-bg); }
|
||||
&--cyan { color: var(--cyan); background: var(--cyan-bg); }
|
||||
&--violet { color: var(--violet); background: var(--violet-bg); }
|
||||
&--accent { color: var(--accent-bright); background: var(--accent-bg); }
|
||||
&--gray { color: var(--text-faint); background: var(--surface-3); }
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// EnvTag — environment / category tag (PROD / DEV / STAGING …)
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -61,3 +61,21 @@
|
||||
margin-bottom: $spacing-md;
|
||||
}
|
||||
}
|
||||
|
||||
// Effective global overrides (moved verbatim from pages/_email.scss, where a
|
||||
// legacy unscoped `.empty-state` block used to win the cascade app-wide).
|
||||
// Top-level `.empty-state` copies still exist in pages/_security.scss and
|
||||
// pages/_servers.scss, which import AFTER this partial — at equal specificity
|
||||
// they would re-widen the padding and restore `<p>` bottom margins. The `html`
|
||||
// prefix (0,1,1) outranks those (0,1,0)/(0,1,1) blocks, while still losing to
|
||||
// the intentional higher-specificity rules (`.card .empty-state` padding from
|
||||
// _cards.scss, `--lg` child overrides, page-scoped copies). Fold this into the
|
||||
// base block above once the page-partial copies are consolidated here.
|
||||
html .empty-state {
|
||||
padding: $space-8;
|
||||
color: $text-secondary;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@@ -116,17 +116,13 @@
|
||||
&--files { background: var(--amber-bg); color: var(--amber); }
|
||||
}
|
||||
|
||||
// mono type chip (application / database / files)
|
||||
// mono type chip (application / database / files) — %sk-state shape
|
||||
// (_design-system.scss) with local sizing + bordered per-type tints kept
|
||||
.bk-type {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@extend %sk-state;
|
||||
padding: 2px 7px;
|
||||
border-radius: 5px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10.5px;
|
||||
font-weight: $font-weight-semibold;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
color: var(--text-dim);
|
||||
|
||||
@@ -557,56 +557,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Legacy unscoped leftovers ────────────────────────────────
|
||||
// Not used by the Email page itself, but `.status-badge` / `.empty-state`
|
||||
// are rendered by other pages (Git deployments, security/settings tabs)
|
||||
// and — because pages import after components in main.scss — these blocks
|
||||
// currently win the cascade app-wide. Kept verbatim to avoid cross-page
|
||||
// regressions; a follow-up should consolidate them into the component
|
||||
// partials (_status-badge.scss / _empty-state.scss) and delete these.
|
||||
|
||||
.status-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: $space-1;
|
||||
padding: 2px $space-2;
|
||||
border-radius: $radius-sm;
|
||||
font-size: $font-size-xs;
|
||||
font-weight: $font-weight-medium;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
&.online {
|
||||
color: $success;
|
||||
background: $bg-elevated;
|
||||
|
||||
&::before {
|
||||
background: $success;
|
||||
}
|
||||
}
|
||||
|
||||
&.offline {
|
||||
color: $danger;
|
||||
background: $bg-elevated;
|
||||
|
||||
&::before {
|
||||
background: $danger;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: $space-8;
|
||||
color: $text-secondary;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@@ -192,20 +192,14 @@
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
// Mono category chip (private / fork / default / protected / rollback)
|
||||
// Mono category chip (private / fork / default / protected / rollback) —
|
||||
// %sk-state shape (_design-system.scss) with smaller local sizing kept
|
||||
.git-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@extend %sk-state;
|
||||
vertical-align: middle;
|
||||
margin-left: 7px;
|
||||
padding: 1px 6px;
|
||||
border-radius: 5px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
font-weight: $font-weight-semibold;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
color: var(--text-faint);
|
||||
background: var(--surface-3);
|
||||
|
||||
|
||||
@@ -279,17 +279,10 @@
|
||||
&--info { background: var(--cyan); }
|
||||
}
|
||||
|
||||
// State chip (prototype .alert-state: st-firing / st-resolved)
|
||||
// State chip (prototype .alert-state: st-firing / st-resolved) —
|
||||
// shape from the shared %sk-state primitive (_design-system.scss)
|
||||
.mon-state {
|
||||
padding: 3px 9px;
|
||||
border-radius: 6px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
font-weight: $font-weight-semibold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
@extend %sk-state;
|
||||
|
||||
&--red { color: var(--red); background: var(--red-bg); }
|
||||
&--amber { color: var(--amber); background: var(--amber-bg); }
|
||||
|
||||
@@ -113,18 +113,10 @@
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
// Severity / state chip (mono uppercase on a semantic wash)
|
||||
// Severity / state chip (mono uppercase on a semantic wash) —
|
||||
// shape from the shared %sk-state primitive (_design-system.scss)
|
||||
.sec-state {
|
||||
display: inline-block;
|
||||
padding: 3px 9px;
|
||||
border-radius: 6px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
font-weight: $font-weight-semibold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
@extend %sk-state;
|
||||
|
||||
&--red { color: var(--red); background: var(--red-bg); }
|
||||
&--amber { color: var(--amber); background: var(--amber-bg); }
|
||||
|
||||
@@ -1966,8 +1966,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: $space-2;
|
||||
font-size: $font-size-sm;
|
||||
color: $text-secondary;
|
||||
font-family: var(--mono);
|
||||
font-size: 11.5px;
|
||||
color: var(--text-dim);
|
||||
margin-bottom: $space-5;
|
||||
}
|
||||
|
||||
@@ -1976,10 +1977,11 @@
|
||||
height: 8px;
|
||||
border-radius: $radius-full;
|
||||
flex-shrink: 0;
|
||||
background: var(--text-ghost);
|
||||
|
||||
&.active {
|
||||
background: $success;
|
||||
box-shadow: 0 0 6px fade($success, 40%);
|
||||
background: var(--green);
|
||||
box-shadow: 0 0 6px var(--green);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2137,9 +2139,9 @@
|
||||
}
|
||||
|
||||
.install-tab {
|
||||
background: $bg-elevated;
|
||||
border: 1px solid $border-subtle;
|
||||
border-radius: $radius-lg;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border-soft);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -2148,11 +2150,11 @@
|
||||
align-items: center;
|
||||
gap: $space-3;
|
||||
padding: $space-3 $space-4;
|
||||
background: $bg-hover;
|
||||
border-bottom: 1px solid $border-subtle;
|
||||
background: var(--surface-2);
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
|
||||
> svg {
|
||||
color: $text-tertiary;
|
||||
color: var(--text-faint);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
@@ -2163,28 +2165,31 @@
|
||||
|
||||
> span:first-child {
|
||||
display: block;
|
||||
font-size: $font-size-sm;
|
||||
font-weight: $font-weight-medium;
|
||||
color: $text-primary;
|
||||
font-family: var(--mono);
|
||||
font-size: 10.5px;
|
||||
font-weight: $font-weight-semibold;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
}
|
||||
|
||||
.install-tab-description {
|
||||
display: block;
|
||||
font-size: $font-size-xs;
|
||||
color: $text-tertiary;
|
||||
font-size: 11px;
|
||||
color: var(--text-faint);
|
||||
font-weight: $font-weight-normal;
|
||||
margin-top: 1px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.install-script {
|
||||
padding: $space-4 $space-5;
|
||||
margin: 0;
|
||||
font-family: $font-mono;
|
||||
font-size: $font-size-xs;
|
||||
line-height: $line-height-relaxed;
|
||||
color: $text-secondary;
|
||||
background: $bg-body;
|
||||
font-family: var(--mono);
|
||||
font-size: 11.5px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-dim);
|
||||
background: var(--bg-code);
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
@@ -2195,9 +2200,9 @@
|
||||
// scripts (which are now an "I haven't installed the agent yet" fallback).
|
||||
.connection-string-field {
|
||||
margin-top: $space-5;
|
||||
border: 1px solid $border-subtle;
|
||||
border-radius: $radius-lg;
|
||||
background: $bg-elevated;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
background: var(--surface);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -2206,25 +2211,33 @@
|
||||
align-items: center;
|
||||
gap: $space-3;
|
||||
padding: $space-3 $space-4;
|
||||
background: $bg-card;
|
||||
border-bottom: 1px solid $border-subtle;
|
||||
background: var(--surface-2);
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
|
||||
> svg {
|
||||
color: var(--accent-bright);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
> span {
|
||||
flex: 1;
|
||||
font-size: $font-size-sm;
|
||||
font-family: var(--mono);
|
||||
font-size: 10.5px;
|
||||
font-weight: $font-weight-semibold;
|
||||
color: $text-primary;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-dim);
|
||||
}
|
||||
}
|
||||
|
||||
.connection-string-field__value {
|
||||
padding: $space-4 $space-5;
|
||||
margin: 0;
|
||||
font-family: $font-mono;
|
||||
font-size: $font-size-sm;
|
||||
font-family: var(--mono);
|
||||
font-size: 12.5px;
|
||||
line-height: $line-height-relaxed;
|
||||
color: $text-primary;
|
||||
background: $bg-body;
|
||||
color: var(--text);
|
||||
background: var(--bg-code);
|
||||
overflow-x: auto;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
|
||||
@@ -407,17 +407,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Incident state + impact chips (prototype .inc-state)
|
||||
// Incident state + impact chips (prototype .inc-state) — shape from
|
||||
// the shared %sk-state primitive (_design-system.scss)
|
||||
.inc-state,
|
||||
.inc-impact {
|
||||
padding: 3px 9px;
|
||||
border-radius: 6px;
|
||||
font-family: var(--mono);
|
||||
font-size: 10px;
|
||||
font-weight: $font-weight-semibold;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
white-space: nowrap;
|
||||
@extend %sk-state;
|
||||
}
|
||||
|
||||
.inc-state {
|
||||
|
||||
@@ -77,17 +77,6 @@ export const connectionLabels = {
|
||||
'logic_if-notification': 'If so notify'
|
||||
};
|
||||
|
||||
// Colors for connection types
|
||||
export const connectionColors = {
|
||||
'domain-dockerApp': '#10b981',
|
||||
'domain-service': '#10b981',
|
||||
'dockerApp-dockerApp': '#2496ed',
|
||||
'dockerApp-database': '#f59e0b',
|
||||
'service-dockerApp': '#6366f1',
|
||||
'service-database': '#f59e0b',
|
||||
'service-service': '#6366f1'
|
||||
};
|
||||
|
||||
/**
|
||||
* Find a node by ID from the nodes array
|
||||
*/
|
||||
@@ -219,6 +208,5 @@ export default {
|
||||
isValidConnection,
|
||||
getConnectionError,
|
||||
getConnectionType,
|
||||
connectionLabels,
|
||||
connectionColors
|
||||
connectionLabels
|
||||
};
|
||||
Reference in new issue
Block a user