Add dark mode toggle in the sidebar
Adds a persistent dark/light theme toggle (localStorage + data-bs-theme on <html>) so it applies globally, including the circuit editor route which has no visible sidebar. An inline beforeInteractive script sets the theme before hydration to avoid a flash of the wrong theme. Bootstrap components pick up data-bs-theme automatically; the custom circuit-grid CSS previously used ~150 hardcoded hex colors, all converted to semantic tokens in globals.css with light/dark values. Verified with a headless-browser pass across the project list, project detail page, circuit editor, project-device drawer and a settings modal in both themes; no console errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
a99980c47b
commit
64ccd1f829
4 changed files with 395 additions and 127 deletions
|
|
@ -3,7 +3,13 @@
|
||||||
Bootstrap bleibt Basis für Formulare/Tabellen/Modals; wir tönen die
|
Bootstrap bleibt Basis für Formulare/Tabellen/Modals; wir tönen die
|
||||||
vorhandenen Bootstrap-Komponenten über deren eigene --bs-btn-*-Variablen
|
vorhandenen Bootstrap-Komponenten über deren eigene --bs-btn-*-Variablen
|
||||||
um (globals.css lädt nach bootstrap.min.css, gleiche Spezifität gewinnt
|
um (globals.css lädt nach bootstrap.min.css, gleiche Spezifität gewinnt
|
||||||
per Ladereihenfolge) statt Bootstrap zu ersetzen. */
|
per Ladereihenfolge) statt Bootstrap zu ersetzen.
|
||||||
|
|
||||||
|
Dark mode: Bootstrap schaltet seine eigenen Komponenten (Formulare,
|
||||||
|
Modals, Cards, Alerts, ...) automatisch um, sobald `data-bs-theme="dark"`
|
||||||
|
auf <html> steht (gesetzt von ThemeToggle.tsx, persistiert in
|
||||||
|
localStorage). Der custom Stromkreis-Grid nutzt dafür dieselben
|
||||||
|
Tokens unten, per `:root[data-bs-theme="dark"]` überschrieben. */
|
||||||
:root {
|
:root {
|
||||||
--color-primary: #1c3f52; /* Petrol */
|
--color-primary: #1c3f52; /* Petrol */
|
||||||
--color-primary-dark: #0f2733; /* Petrol Dark */
|
--color-primary-dark: #0f2733; /* Petrol Dark */
|
||||||
|
|
@ -33,6 +39,105 @@
|
||||||
--space-xl: 40px;
|
--space-xl: 40px;
|
||||||
|
|
||||||
--radius: 12px;
|
--radius: 12px;
|
||||||
|
|
||||||
|
/* ── Grid/Editor-Tokens (hell) ──────────────────────────────────────── */
|
||||||
|
--panel-bg: #ffffff;
|
||||||
|
--panel-bg-subtle: #f8fafc;
|
||||||
|
--panel-border: #d9dee8;
|
||||||
|
--panel-border-strong: #c4cddc;
|
||||||
|
--input-border: #9fb6e0;
|
||||||
|
--text-strong: #1f2937;
|
||||||
|
--text-muted: #4b5563;
|
||||||
|
--text-faint: #6b7280;
|
||||||
|
--text-subtle: #475569;
|
||||||
|
|
||||||
|
--accent-blue: #2563eb;
|
||||||
|
--accent-blue-soft-bg: #eff6ff;
|
||||||
|
--accent-blue-border: #bfdbfe;
|
||||||
|
--accent-blue-strong-border: #4c7dd9;
|
||||||
|
--accent-blue-drop-border: #2b6cb0;
|
||||||
|
--accent-blue-marker: #1d4ed8;
|
||||||
|
|
||||||
|
--surface-selected: #eaf1ff;
|
||||||
|
--surface-header-row: #e8eef8;
|
||||||
|
--surface-component-header: #e2e8f0;
|
||||||
|
--surface-component-group: #f8fafc;
|
||||||
|
--surface-component-footer: #f1f5f9;
|
||||||
|
--surface-hover: #f3f4f6;
|
||||||
|
|
||||||
|
--grid-warn: #d97706;
|
||||||
|
--grid-warn-bg: #fff7ed;
|
||||||
|
--grid-warn-strong: #9a3412;
|
||||||
|
--grid-danger: #c2410c;
|
||||||
|
|
||||||
|
--notice-info-bg: #ebf3ff;
|
||||||
|
--notice-info-border: #bad1f7;
|
||||||
|
--notice-error-bg: #fdecec;
|
||||||
|
--notice-error-border: #f5b5b5;
|
||||||
|
--notice-warning-bg: #fff7ed;
|
||||||
|
--notice-warning-border: #fdba74;
|
||||||
|
--notice-muted-bg: #f6f6f6;
|
||||||
|
--notice-muted-border: #e4e4e4;
|
||||||
|
|
||||||
|
--shadow-soft: rgba(15, 39, 51, 0.07);
|
||||||
|
--shadow-strong: rgba(15, 39, 51, 0.28);
|
||||||
|
--shadow-menu: rgba(0, 0, 0, 0.12);
|
||||||
|
--shadow-drawer: rgba(31, 41, 55, 0.22);
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] {
|
||||||
|
--color-ink: #e6ecef;
|
||||||
|
--color-ink-soft: #9db0b8;
|
||||||
|
--color-bg: #141b20;
|
||||||
|
--color-surface: #0f1519;
|
||||||
|
--color-border: #2a3941;
|
||||||
|
--color-danger: #e2664f;
|
||||||
|
--color-danger-bg: #33201c;
|
||||||
|
--color-warn: #e0983f;
|
||||||
|
|
||||||
|
/* ── Grid/Editor-Tokens (dunkel) ────────────────────────────────────── */
|
||||||
|
--panel-bg: #182229;
|
||||||
|
--panel-bg-subtle: #1c2830;
|
||||||
|
--panel-border: #2c3c45;
|
||||||
|
--panel-border-strong: #374a54;
|
||||||
|
--input-border: #3c5568;
|
||||||
|
--text-strong: #e6ecef;
|
||||||
|
--text-muted: #aebdc4;
|
||||||
|
--text-faint: #8798a0;
|
||||||
|
--text-subtle: #9db0b8;
|
||||||
|
|
||||||
|
--accent-blue: #6fa2f7;
|
||||||
|
--accent-blue-soft-bg: #17253a;
|
||||||
|
--accent-blue-border: #2c4a72;
|
||||||
|
--accent-blue-strong-border: #6fa2f7;
|
||||||
|
--accent-blue-drop-border: #4f84d6;
|
||||||
|
--accent-blue-marker: #6fa2f7;
|
||||||
|
|
||||||
|
--surface-selected: #17253a;
|
||||||
|
--surface-header-row: #1a262f;
|
||||||
|
--surface-component-header: #202e37;
|
||||||
|
--surface-component-group: #1a262f;
|
||||||
|
--surface-component-footer: #182229;
|
||||||
|
--surface-hover: #1f2b33;
|
||||||
|
|
||||||
|
--grid-warn: #e0983f;
|
||||||
|
--grid-warn-bg: #2e2214;
|
||||||
|
--grid-warn-strong: #f0b880;
|
||||||
|
--grid-danger: #e2825f;
|
||||||
|
|
||||||
|
--notice-info-bg: #182839;
|
||||||
|
--notice-info-border: #2c4a72;
|
||||||
|
--notice-error-bg: #33201c;
|
||||||
|
--notice-error-border: #5c332c;
|
||||||
|
--notice-warning-bg: #2e2214;
|
||||||
|
--notice-warning-border: #6b4a1c;
|
||||||
|
--notice-muted-bg: #1b2226;
|
||||||
|
--notice-muted-border: #2a3338;
|
||||||
|
|
||||||
|
--shadow-soft: rgba(0, 0, 0, 0.35);
|
||||||
|
--shadow-strong: rgba(0, 0, 0, 0.55);
|
||||||
|
--shadow-menu: rgba(0, 0, 0, 0.45);
|
||||||
|
--shadow-drawer: rgba(0, 0, 0, 0.55);
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
|
|
@ -109,6 +214,12 @@ a {
|
||||||
--bs-alert-border-color: #b6e2ce;
|
--bs-alert-border-color: #b6e2ce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] .alert-success {
|
||||||
|
--bs-alert-color: #7fd6a7;
|
||||||
|
--bs-alert-bg: #16291f;
|
||||||
|
--bs-alert-border-color: #205a38;
|
||||||
|
}
|
||||||
|
|
||||||
/* ── App-Shell / Seitenleiste (nur auf der Projektseite) ────────────────── */
|
/* ── App-Shell / Seitenleiste (nur auf der Projektseite) ────────────────── */
|
||||||
|
|
||||||
.app-shell {
|
.app-shell {
|
||||||
|
|
@ -165,6 +276,7 @@ a {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-section-label {
|
.sidebar-section-label {
|
||||||
|
|
@ -210,6 +322,32 @@ a {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar-footer {
|
||||||
|
padding: 12px;
|
||||||
|
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-theme-toggle {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #c7d6e0;
|
||||||
|
font-size: 0.92rem;
|
||||||
|
font-weight: 500;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||||
|
background: rgba(255, 255, 255, 0.06);
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-theme-toggle:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.14);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
.app-shell-content {
|
.app-shell-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
@ -230,6 +368,10 @@ a {
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] .page-header h1 {
|
||||||
|
color: var(--color-accent-pale);
|
||||||
|
}
|
||||||
|
|
||||||
.kicker {
|
.kicker {
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
letter-spacing: 0.12em;
|
letter-spacing: 0.12em;
|
||||||
|
|
@ -262,7 +404,7 @@ a {
|
||||||
a.kpi:hover {
|
a.kpi:hover {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
box-shadow: 0 3px 8px rgba(15, 39, 51, 0.07), 0 16px 32px -14px rgba(15, 39, 51, 0.28);
|
box-shadow: 0 3px 8px var(--shadow-soft), 0 16px 32px -14px var(--shadow-strong);
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,12 +427,16 @@ a.kpi:hover {
|
||||||
color: var(--color-primary);
|
color: var(--color-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] .kpi-value {
|
||||||
|
color: var(--color-accent-pale);
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
border-radius: var(--radius);
|
border-radius: var(--radius);
|
||||||
border-top: 3px solid var(--color-primary);
|
border-top: 3px solid var(--color-primary);
|
||||||
box-shadow:
|
box-shadow:
|
||||||
0 1px 2px rgba(15, 39, 51, 0.05),
|
0 1px 2px var(--shadow-soft),
|
||||||
0 10px 24px -14px rgba(15, 39, 51, 0.22);
|
0 10px 24px -14px var(--shadow-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
|
|
@ -300,6 +446,10 @@ a.kpi:hover {
|
||||||
border-bottom: 1px solid var(--color-border);
|
border-bottom: 1px solid var(--color-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] .card-header {
|
||||||
|
color: var(--color-accent-pale);
|
||||||
|
}
|
||||||
|
|
||||||
.table td input.form-control-sm,
|
.table td input.form-control-sm,
|
||||||
.table td select.form-select-sm {
|
.table td select.form-select-sm {
|
||||||
min-width: 8rem;
|
min-width: 8rem;
|
||||||
|
|
@ -320,13 +470,14 @@ a.kpi:hover {
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
padding: 0.35rem 0;
|
padding: 0.35rem 0;
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
box-shadow: 0 1px 0 rgba(196, 205, 220, 0.8);
|
box-shadow: 0 1px 0 var(--panel-border-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar button {
|
.editor-toolbar button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
padding: 0.28rem 0.6rem;
|
padding: 0.28rem 0.6rem;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
font-size: 0.82rem;
|
font-size: 0.82rem;
|
||||||
|
|
@ -337,8 +488,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-toolbar .project-device-drawer-toggle {
|
.editor-toolbar .project-device-drawer-toggle {
|
||||||
border-color: #2563eb;
|
border-color: var(--accent-blue);
|
||||||
background: #2563eb;
|
background: var(--accent-blue);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
@ -349,10 +500,10 @@ a.kpi:hover {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.35rem;
|
gap: 0.35rem;
|
||||||
padding: 0.4rem 0.5rem;
|
padding: 0.4rem 0.5rem;
|
||||||
border: 1px solid #bfdbfe;
|
border: 1px solid var(--accent-blue-border);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: #eff6ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
color: #1e3a5f;
|
color: var(--text-subtle);
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -362,10 +513,10 @@ a.kpi:hover {
|
||||||
|
|
||||||
.active-view-chip,
|
.active-view-chip,
|
||||||
.active-view-reset {
|
.active-view-reset {
|
||||||
border: 1px solid #93b4df;
|
border: 1px solid var(--accent-blue-border);
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
color: #1e3a5f;
|
color: var(--text-subtle);
|
||||||
padding: 0.18rem 0.48rem;
|
padding: 0.18rem 0.48rem;
|
||||||
font-size: 0.76rem;
|
font-size: 0.76rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
@ -373,7 +524,7 @@ a.kpi:hover {
|
||||||
|
|
||||||
.active-view-chip:hover,
|
.active-view-chip:hover,
|
||||||
.active-view-reset:hover {
|
.active-view-reset:hover {
|
||||||
border-color: #2563eb;
|
border-color: var(--accent-blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
.active-view-reset {
|
.active-view-reset {
|
||||||
|
|
@ -386,9 +537,9 @@ a.kpi:hover {
|
||||||
grid-template-columns: repeat(3, minmax(12rem, 1fr));
|
grid-template-columns: repeat(3, minmax(12rem, 1fr));
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 0.55rem;
|
padding: 0.55rem;
|
||||||
border: 1px solid #cbd5e1;
|
border: 1px solid var(--panel-border);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: #f8fafc;
|
background: var(--panel-bg-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
.distribution-power-summary > div {
|
.distribution-power-summary > div {
|
||||||
|
|
@ -398,13 +549,13 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.distribution-power-summary span {
|
.distribution-power-summary span {
|
||||||
color: #475569;
|
color: var(--text-subtle);
|
||||||
font-size: 0.74rem;
|
font-size: 0.74rem;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.distribution-power-summary strong {
|
.distribution-power-summary strong {
|
||||||
color: #172033;
|
color: var(--text-strong);
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -418,13 +569,13 @@ a.kpi:hover {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
border: 1px solid #cfd7e5;
|
border: 1px solid var(--panel-border);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
|
box-shadow: 0 6px 16px var(--shadow-menu);
|
||||||
padding: 0.55rem;
|
padding: 0.55rem;
|
||||||
width: 340px;
|
width: 340px;
|
||||||
color: #1f2937;
|
color: var(--text-strong);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -444,7 +595,7 @@ a.kpi:hover {
|
||||||
.column-settings-close {
|
.column-settings-close {
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
color: #4b5563;
|
color: var(--text-muted);
|
||||||
padding: 0.05rem 0.2rem !important;
|
padding: 0.05rem 0.2rem !important;
|
||||||
font-size: 1rem !important;
|
font-size: 1rem !important;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
@ -453,7 +604,7 @@ a.kpi:hover {
|
||||||
|
|
||||||
.column-settings-explanation {
|
.column-settings-explanation {
|
||||||
margin-bottom: 0.4rem;
|
margin-bottom: 0.4rem;
|
||||||
color: #4b5563;
|
color: var(--text-muted);
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
}
|
}
|
||||||
|
|
@ -461,9 +612,11 @@ a.kpi:hover {
|
||||||
.column-settings-search {
|
.column-settings-search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 0.4rem;
|
margin-bottom: 0.4rem;
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.3rem 0.4rem;
|
padding: 0.3rem 0.4rem;
|
||||||
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
font-size: 0.76rem;
|
font-size: 0.76rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -473,7 +626,7 @@ a.kpi:hover {
|
||||||
gap: 0.15rem;
|
gap: 0.15rem;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border: 1px solid #e1e6ef;
|
border: 1px solid var(--panel-border);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.25rem;
|
padding: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
@ -489,8 +642,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-item.selected {
|
.column-settings-item.selected {
|
||||||
border-color: #bfdbfe;
|
border-color: var(--accent-blue-border);
|
||||||
background: #eff6ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-item.dragging {
|
.column-settings-item.dragging {
|
||||||
|
|
@ -498,12 +651,12 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-item.drop-target {
|
.column-settings-item.drop-target {
|
||||||
border-color: #2b6cb0;
|
border-color: var(--accent-blue-drop-border);
|
||||||
background: #ebf4ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-item.locked {
|
.column-settings-item.locked {
|
||||||
background: #f7fafc;
|
background: var(--panel-bg-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-visibility-button {
|
.column-visibility-button {
|
||||||
|
|
@ -530,7 +683,7 @@ a.kpi:hover {
|
||||||
flex: 0 0 1rem;
|
flex: 0 0 1rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: #1d4ed8;
|
color: var(--accent-blue-marker);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -540,8 +693,9 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-order button {
|
.column-settings-order button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
padding: 0.08rem 0.28rem;
|
padding: 0.08rem 0.28rem;
|
||||||
|
|
@ -549,8 +703,8 @@ a.kpi:hover {
|
||||||
|
|
||||||
.tree-grid-wrap {
|
.tree-grid-wrap {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border: 1px solid #d9dee8;
|
border: 1px solid var(--panel-border);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|
@ -560,7 +714,7 @@ a.kpi:hover {
|
||||||
|
|
||||||
.column-settings-empty {
|
.column-settings-empty {
|
||||||
padding: 0.55rem 0.35rem;
|
padding: 0.55rem 0.35rem;
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
font-size: 0.76rem;
|
font-size: 0.76rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -570,8 +724,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.column-settings-footer button.primary {
|
.column-settings-footer button.primary {
|
||||||
border-color: #2563eb;
|
border-color: var(--accent-blue);
|
||||||
background: #2563eb;
|
background: var(--accent-blue);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -583,8 +737,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-sidebar {
|
.project-device-sidebar {
|
||||||
border: 1px solid #d9dee8;
|
border: 1px solid var(--panel-border);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
padding: 0.6rem;
|
padding: 0.6rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -594,14 +748,17 @@ a.kpi:hover {
|
||||||
.project-device-sidebar h3 {
|
.project-device-sidebar h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-sidebar input,
|
.project-device-sidebar input,
|
||||||
.project-device-sidebar select {
|
.project-device-sidebar select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid #cfd7e5;
|
border: 1px solid var(--panel-border-strong);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.25rem 0.35rem;
|
padding: 0.25rem 0.35rem;
|
||||||
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-list {
|
.project-device-list {
|
||||||
|
|
@ -613,8 +770,9 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-item {
|
.project-device-item {
|
||||||
border: 1px solid #d5ddec;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #f8faff;
|
background: var(--panel-bg-subtle);
|
||||||
|
color: var(--text-strong);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 0.4rem;
|
padding: 0.4rem;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
@ -625,8 +783,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-item.selected {
|
.project-device-item.selected {
|
||||||
border-color: #4c7dd9;
|
border-color: var(--accent-blue-strong-border);
|
||||||
background: #edf3ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-item.dragging {
|
.project-device-item.dragging {
|
||||||
|
|
@ -645,11 +803,13 @@ a.kpi:hover {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.2rem;
|
gap: 0.2rem;
|
||||||
font-size: 0.82rem;
|
font-size: 0.82rem;
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-actions button {
|
.sidebar-actions button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.3rem 0.45rem;
|
padding: 0.3rem 0.45rem;
|
||||||
font-size: 0.82rem;
|
font-size: 0.82rem;
|
||||||
|
|
@ -660,18 +820,19 @@ a.kpi:hover {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid th,
|
.tree-grid th,
|
||||||
.tree-grid td {
|
.tree-grid td {
|
||||||
border: 1px solid #e4e9f2;
|
border: 1px solid var(--panel-border);
|
||||||
padding: 0.35rem 0.4rem;
|
padding: 0.35rem 0.4rem;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid th {
|
.tree-grid th {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
background: #f4f7fb;
|
background: var(--panel-bg-subtle);
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
@ -694,8 +855,9 @@ a.kpi:hover {
|
||||||
.tree-grid .header-filter-btn {
|
.tree-grid .header-filter-btn {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
padding: 0.15rem 0.35rem;
|
padding: 0.15rem 0.35rem;
|
||||||
|
|
@ -712,7 +874,7 @@ a.kpi:hover {
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
color: #1f2937;
|
color: var(--text-strong);
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
|
@ -733,7 +895,7 @@ a.kpi:hover {
|
||||||
max-height: calc(100vh - 7rem);
|
max-height: calc(100vh - 7rem);
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
box-shadow: 0 0.75rem 2rem rgba(31, 41, 55, 0.22);
|
box-shadow: 0 0.75rem 2rem var(--shadow-drawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-drawer-header {
|
.project-device-drawer-header {
|
||||||
|
|
@ -744,13 +906,14 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-drawer-header span {
|
.project-device-drawer-header span {
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-device-drawer-header button {
|
.project-device-drawer-header button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.25rem 0.4rem;
|
padding: 0.25rem 0.4rem;
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
|
|
@ -762,23 +925,24 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .sort-indicator {
|
.tree-grid .sort-indicator {
|
||||||
color: #2563eb;
|
color: var(--accent-blue);
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-btn.active {
|
.tree-grid .header-filter-btn.active {
|
||||||
border-color: #2563eb;
|
border-color: var(--accent-blue);
|
||||||
color: #2563eb;
|
color: var(--accent-blue);
|
||||||
background: #eff6ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-menu {
|
.tree-grid .header-filter-menu {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 7;
|
z-index: 7;
|
||||||
margin-top: 0.2rem;
|
margin-top: 0.2rem;
|
||||||
border: 1px solid #cfd7e5;
|
border: 1px solid var(--panel-border);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
|
color: var(--text-strong);
|
||||||
|
box-shadow: 0 6px 16px var(--shadow-menu);
|
||||||
width: 300px;
|
width: 300px;
|
||||||
padding: 0.55rem;
|
padding: 0.55rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
@ -802,7 +966,7 @@ a.kpi:hover {
|
||||||
.tree-grid .header-filter-close {
|
.tree-grid .header-filter-close {
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: #4b5563;
|
color: var(--text-muted);
|
||||||
padding: 0.05rem 0.2rem;
|
padding: 0.05rem 0.2rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|
@ -817,13 +981,14 @@ a.kpi:hover {
|
||||||
|
|
||||||
.tree-grid .header-filter-selection-actions span {
|
.tree-grid .header-filter-selection-actions span {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
color: #4b5563;
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-selection-actions button,
|
.tree-grid .header-filter-selection-actions button,
|
||||||
.tree-grid .header-filter-footer button {
|
.tree-grid .header-filter-footer button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 0.18rem 0.35rem;
|
padding: 0.18rem 0.35rem;
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
|
|
@ -832,7 +997,7 @@ a.kpi:hover {
|
||||||
|
|
||||||
.tree-grid .header-filter-explanation {
|
.tree-grid .header-filter-explanation {
|
||||||
margin-bottom: 0.4rem;
|
margin-bottom: 0.4rem;
|
||||||
color: #4b5563;
|
color: var(--text-muted);
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
|
|
@ -840,9 +1005,11 @@ a.kpi:hover {
|
||||||
|
|
||||||
.tree-grid .header-filter-search {
|
.tree-grid .header-filter-search {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.3rem 0.4rem;
|
padding: 0.3rem 0.4rem;
|
||||||
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
font-size: 0.76rem;
|
font-size: 0.76rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -852,7 +1019,7 @@ a.kpi:hover {
|
||||||
gap: 0.15rem;
|
gap: 0.15rem;
|
||||||
max-height: 210px;
|
max-height: 210px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border: 1px solid #e1e6ef;
|
border: 1px solid var(--panel-border);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
padding: 0.25rem;
|
padding: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
@ -866,7 +1033,7 @@ a.kpi:hover {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 0.25rem 0.3rem;
|
padding: 0.25rem 0.3rem;
|
||||||
color: #1f2937;
|
color: var(--text-strong);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|
@ -874,17 +1041,17 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-item:hover {
|
.tree-grid .header-filter-item:hover {
|
||||||
background: #f3f4f6;
|
background: var(--surface-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-item.selected {
|
.tree-grid .header-filter-item.selected {
|
||||||
border-color: #bfdbfe;
|
border-color: var(--accent-blue-border);
|
||||||
background: #eff6ff;
|
background: var(--accent-blue-soft-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-empty {
|
.tree-grid .header-filter-empty {
|
||||||
padding: 0.45rem 0.25rem;
|
padding: 0.45rem 0.25rem;
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
font-size: 0.74rem;
|
font-size: 0.74rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -897,8 +1064,8 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-footer button.primary {
|
.tree-grid .header-filter-footer button.primary {
|
||||||
border-color: #2563eb;
|
border-color: var(--accent-blue);
|
||||||
background: #2563eb;
|
background: var(--accent-blue);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -908,7 +1075,7 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .header-filter-warning {
|
.tree-grid .header-filter-warning {
|
||||||
color: #9a3412;
|
color: var(--grid-warn-strong);
|
||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
@ -918,25 +1085,25 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .section-row td {
|
.tree-grid .section-row td {
|
||||||
background: #e8eef8;
|
background: var(--surface-header-row);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-row td {
|
.tree-grid .structure-component-row td {
|
||||||
padding: 0.38rem 0.6rem;
|
padding: 0.38rem 0.6rem;
|
||||||
border-bottom-color: #d8dee9;
|
border-bottom-color: var(--panel-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-row.headerComponent td {
|
.tree-grid .structure-component-row.headerComponent td {
|
||||||
background: #e2e8f0;
|
background: var(--surface-component-header);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-row.groupComponent td {
|
.tree-grid .structure-component-row.groupComponent td {
|
||||||
background: #f8fafc;
|
background: var(--surface-component-group);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-row.footerComponent td {
|
.tree-grid .structure-component-row.footerComponent td {
|
||||||
background: #f1f5f9;
|
background: var(--surface-component-footer);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-content {
|
.tree-grid .structure-component-content {
|
||||||
|
|
@ -952,7 +1119,7 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-protection {
|
.tree-grid .structure-component-protection {
|
||||||
color: #475569;
|
color: var(--text-subtle);
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -969,7 +1136,7 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .structure-component-fixed {
|
.tree-grid .structure-component-fixed {
|
||||||
color: #64748b;
|
color: var(--text-faint);
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -990,32 +1157,33 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .section-actions button {
|
.tree-grid .section-actions button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
padding: 0.2rem 0.45rem;
|
padding: 0.2rem 0.45rem;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .summary-row td {
|
.tree-grid .summary-row td {
|
||||||
background: #f3f7fd;
|
background: var(--panel-bg-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .device-row td:first-child {
|
.tree-grid .device-row td:first-child {
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .empty-circuit-row td {
|
.tree-grid .empty-circuit-row td {
|
||||||
background: #f8fbff;
|
background: var(--panel-bg-subtle);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid tr.row-selected td {
|
.tree-grid tr.row-selected td {
|
||||||
background: #eaf1ff;
|
background: var(--surface-selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .placeholder-row td {
|
.tree-grid .placeholder-row td {
|
||||||
background: #f7f7f7;
|
background: var(--panel-bg-subtle);
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1032,8 +1200,12 @@ a.kpi:hover {
|
||||||
box-shadow 0.12s ease;
|
box-shadow 0.12s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root[data-bs-theme="dark"] .tree-grid .cell-protection-trigger {
|
||||||
|
color: var(--color-accent-pale);
|
||||||
|
}
|
||||||
|
|
||||||
.tree-grid .cell-protection-trigger:hover {
|
.tree-grid .cell-protection-trigger:hover {
|
||||||
background: #eaf6f0;
|
background: rgba(63, 166, 107, 0.15);
|
||||||
box-shadow: inset 0 0 0 1px var(--color-signal);
|
box-shadow: inset 0 0 0 1px var(--color-signal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1054,7 +1226,7 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .cell-selected {
|
.tree-grid .cell-selected {
|
||||||
outline: 2px solid #4c7dd9;
|
outline: 2px solid var(--accent-blue-strong-border);
|
||||||
outline-offset: -2px;
|
outline-offset: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1065,28 +1237,30 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .section-title span {
|
.tree-grid .section-title span {
|
||||||
color: #475569;
|
color: var(--text-subtle);
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .cell-invalid {
|
.tree-grid .cell-invalid {
|
||||||
outline: 2px solid #c2410c;
|
outline: 2px solid var(--grid-danger);
|
||||||
outline-offset: -2px;
|
outline-offset: -2px;
|
||||||
background: #fff7ed !important;
|
background: var(--grid-warn-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .cell-invalid input {
|
.tree-grid .cell-invalid input {
|
||||||
border-color: #c2410c;
|
border-color: var(--grid-danger);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid input,
|
.tree-grid input,
|
||||||
.tree-grid select {
|
.tree-grid select {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 5rem;
|
min-width: 5rem;
|
||||||
border: 1px solid #9fb6e0;
|
border: 1px solid var(--input-border);
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: 0.2rem 0.3rem;
|
padding: 0.2rem 0.3rem;
|
||||||
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .action-cell {
|
.tree-grid .action-cell {
|
||||||
|
|
@ -1095,26 +1269,27 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .action-cell button {
|
.tree-grid .action-cell button {
|
||||||
border: 1px solid #c4cddc;
|
border: 1px solid var(--panel-border-strong);
|
||||||
background: #fff;
|
background: var(--panel-bg);
|
||||||
|
color: var(--text-strong);
|
||||||
padding: 0.2rem 0.45rem;
|
padding: 0.2rem 0.45rem;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .drop-target-active {
|
.tree-grid .drop-target-active {
|
||||||
box-shadow: inset 0 0 0 2px #4c7dd9;
|
box-shadow: inset 0 0 0 2px var(--accent-blue-strong-border);
|
||||||
background: #eef4ff !important;
|
background: var(--accent-blue-soft-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .drop-target-invalid {
|
.tree-grid .drop-target-invalid {
|
||||||
box-shadow: inset 0 0 0 2px #d97706;
|
box-shadow: inset 0 0 0 2px var(--grid-warn);
|
||||||
background: #fff7ed !important;
|
background: var(--grid-warn-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid .drop-target-confirm {
|
.tree-grid .drop-target-confirm {
|
||||||
box-shadow: inset 0 0 0 2px #d97706;
|
box-shadow: inset 0 0 0 2px var(--grid-warn);
|
||||||
background: #fffbeb !important;
|
background: var(--grid-warn-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-grid tr.circuit-insert-before td,
|
.tree-grid tr.circuit-insert-before td,
|
||||||
|
|
@ -1128,7 +1303,7 @@ a.kpi:hover {
|
||||||
left: -1px;
|
left: -1px;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
top: -2px;
|
top: -2px;
|
||||||
border-top: 4px solid #2563eb;
|
border-top: 4px solid var(--accent-blue);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1141,7 +1316,7 @@ a.kpi:hover {
|
||||||
height: 0;
|
height: 0;
|
||||||
border-top: 7px solid transparent;
|
border-top: 7px solid transparent;
|
||||||
border-bottom: 7px solid transparent;
|
border-bottom: 7px solid transparent;
|
||||||
border-left: 10px solid #2563eb;
|
border-left: 10px solid var(--accent-blue);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1151,7 +1326,7 @@ a.kpi:hover {
|
||||||
left: -1px;
|
left: -1px;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
bottom: -2px;
|
bottom: -2px;
|
||||||
border-bottom: 4px solid #2563eb;
|
border-bottom: 4px solid var(--accent-blue);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1164,13 +1339,13 @@ a.kpi:hover {
|
||||||
height: 0;
|
height: 0;
|
||||||
border-top: 7px solid transparent;
|
border-top: 7px solid transparent;
|
||||||
border-bottom: 7px solid transparent;
|
border-bottom: 7px solid transparent;
|
||||||
border-left: 10px solid #2563eb;
|
border-left: 10px solid var(--accent-blue);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drop-hint {
|
.drop-hint {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
color: #1f4ea3;
|
color: var(--accent-blue-marker);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1178,21 +1353,22 @@ a.kpi:hover {
|
||||||
padding: 0.5rem 0.75rem;
|
padding: 0.5rem 0.75rem;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
|
color: var(--text-strong);
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice.info {
|
.notice.info {
|
||||||
background: #ebf3ff;
|
background: var(--notice-info-bg);
|
||||||
border-color: #bad1f7;
|
border-color: var(--notice-info-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice.error {
|
.notice.error {
|
||||||
background: #fdecec;
|
background: var(--notice-error-bg);
|
||||||
border-color: #f5b5b5;
|
border-color: var(--notice-error-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice.warning {
|
.notice.warning {
|
||||||
background: #fff7ed;
|
background: var(--notice-warning-bg);
|
||||||
border-color: #fdba74;
|
border-color: var(--notice-warning-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor-error-notice {
|
.editor-error-notice {
|
||||||
|
|
@ -1203,12 +1379,13 @@ a.kpi:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
.notice.muted {
|
.notice.muted {
|
||||||
background: #f6f6f6;
|
background: var(--notice-muted-bg);
|
||||||
border-color: #e4e4e4;
|
border-color: var(--notice-muted-border);
|
||||||
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
.todo-hint {
|
.todo-hint {
|
||||||
color: #6b7280;
|
color: var(--text-faint);
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
import Script from "next/script";
|
||||||
import "bootstrap/dist/css/bootstrap.min.css";
|
import "bootstrap/dist/css/bootstrap.min.css";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { AppShell } from "../frontend/components/AppShell";
|
import { AppShell } from "../frontend/components/AppShell";
|
||||||
|
|
@ -8,10 +9,33 @@ export const metadata: Metadata = {
|
||||||
description: "Leistungsbilanz für elektrische Verbraucher und Stromkreislisten",
|
description: "Leistungsbilanz für elektrische Verbraucher und Stromkreislisten",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Keep this key literal in sync with THEME_STORAGE_KEY in ThemeToggle.tsx.
|
||||||
|
// It must stay inline (not imported) so it runs before hydration and never
|
||||||
|
// flashes the wrong theme on load.
|
||||||
|
const THEME_INIT_SCRIPT = `
|
||||||
|
(function () {
|
||||||
|
try {
|
||||||
|
var stored = localStorage.getItem("leistungsbilanz:theme");
|
||||||
|
var theme =
|
||||||
|
stored === "dark" || stored === "light"
|
||||||
|
? stored
|
||||||
|
: window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||||
|
? "dark"
|
||||||
|
: "light";
|
||||||
|
document.documentElement.setAttribute("data-bs-theme", theme);
|
||||||
|
} catch (error) {
|
||||||
|
// Storage/matchMedia unavailable: fall back to the default light theme.
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
`;
|
||||||
|
|
||||||
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||||
return (
|
return (
|
||||||
<html lang="de">
|
<html lang="de" suppressHydrationWarning>
|
||||||
<body>
|
<body>
|
||||||
|
<Script id="theme-init" strategy="beforeInteractive">
|
||||||
|
{THEME_INIT_SCRIPT}
|
||||||
|
</Script>
|
||||||
<AppShell>{children}</AppShell>
|
<AppShell>{children}</AppShell>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { listProjects } from "../utils/api";
|
import { listProjects } from "../utils/api";
|
||||||
import type { ProjectDto } from "../types";
|
import type { ProjectDto } from "../types";
|
||||||
|
import { ThemeToggle } from "./ThemeToggle";
|
||||||
|
|
||||||
const PROJECT_SECTIONS = [
|
const PROJECT_SECTIONS = [
|
||||||
{ id: "verlauf", label: "Verlauf", icon: "↺" },
|
{ id: "verlauf", label: "Verlauf", icon: "↺" },
|
||||||
|
|
@ -116,6 +117,9 @@ export function Sidebar() {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</nav>
|
</nav>
|
||||||
|
<div className="sidebar-footer">
|
||||||
|
<ThemeToggle />
|
||||||
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
63
src/frontend/components/ThemeToggle.tsx
Normal file
63
src/frontend/components/ThemeToggle.tsx
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
export const THEME_STORAGE_KEY = "leistungsbilanz:theme";
|
||||||
|
|
||||||
|
type Theme = "light" | "dark";
|
||||||
|
|
||||||
|
function applyTheme(theme: Theme) {
|
||||||
|
document.documentElement.setAttribute("data-bs-theme", theme);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ThemeToggle() {
|
||||||
|
const [theme, setTheme] = useState<Theme>("light");
|
||||||
|
|
||||||
|
// The inline script in layout.tsx already applied the persisted/system
|
||||||
|
// theme before hydration; read it back so the toggle starts in sync
|
||||||
|
// instead of flashing to "light" first.
|
||||||
|
useEffect(() => {
|
||||||
|
const current = document.documentElement.getAttribute("data-bs-theme");
|
||||||
|
setTheme(current === "dark" ? "dark" : "light");
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
function handleStorage(event: StorageEvent) {
|
||||||
|
if (
|
||||||
|
event.key === THEME_STORAGE_KEY &&
|
||||||
|
(event.newValue === "dark" || event.newValue === "light")
|
||||||
|
) {
|
||||||
|
setTheme(event.newValue);
|
||||||
|
applyTheme(event.newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
window.addEventListener("storage", handleStorage);
|
||||||
|
return () => window.removeEventListener("storage", handleStorage);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
function toggleTheme() {
|
||||||
|
const next: Theme = theme === "dark" ? "light" : "dark";
|
||||||
|
setTheme(next);
|
||||||
|
applyTheme(next);
|
||||||
|
try {
|
||||||
|
localStorage.setItem(THEME_STORAGE_KEY, next);
|
||||||
|
} catch {
|
||||||
|
// Private browsing or disabled storage: theme still applies for
|
||||||
|
// this page load, just without persistence across reloads.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
aria-pressed={theme === "dark"}
|
||||||
|
className="sidebar-theme-toggle"
|
||||||
|
onClick={toggleTheme}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span className="sidebar-icon" aria-hidden="true">
|
||||||
|
{theme === "dark" ? "☀" : "☾"}
|
||||||
|
</span>
|
||||||
|
{theme === "dark" ? "Hellmodus" : "Dunkelmodus"}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue