Skip to content

Real-time network monitor + outbound firewall — see & block every connection. Privacy-first, local-first, Rust fleet agent, SIEM exports, 8 languages. / Moniteur réseau temps réel + pare-feu sortant, agent de flotte Rust, exports SIEM. 100 % local.

v1.0.8: native light theme via design tokens

MoneyLisab05f01509d1f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e7daae..b4a7806 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,12 @@ All notable changes to Snitch. / Toutes les modifications notables de Snitch.
The format follows [Keep a Changelog](https://keepachangelog.com/) — EN/FR.
+## [1.0.8] — 2026-10-22
+
+### Changed / Modifié
+
+- **True native light theme / Vrai thème clair natif** — replaces the v1.0.7 invert filter with a full design-token system: every surface, text, border and accent colour in the app paints through CSS custom properties with a hand-picked light palette. Map, force graph, timeline and the WebGL aurora all follow the theme, and the toggle still persists your choice. / Remplace le filtre d'inversion de la v1.0.7 par un système de tokens : chaque surface, texte, bordure et accent passe par des variables CSS avec une palette claire choisie à la main. Carte, graphe, timeline et aurore WebGL suivent le thème, et le choix reste persisté.
+
## [1.0.7] — 2026-10-22
### Added / Ajouté
diff --git a/backend/version.py b/backend/version.py
index 17f0b10..139c108 100644
--- a/backend/version.py
+++ b/backend/version.py
@@ -5,4 +5,4 @@ FR: Source unique de la version du backend (affichée dans /diagnostics).
À garder alignée avec electron/package.json et frontend/package.json.
"""
-__version__ = "1.0.7"
+__version__ = "1.0.8"
diff --git a/electron/package.json b/electron/package.json
index 0ae8b96..0ce569e 100644
--- a/electron/package.json
+++ b/electron/package.json
@@ -1,6 +1,6 @@
{
"name": "snitch",
- "version": "1.0.7",
+ "version": "1.0.8",
"description": "Snitch — real-time network traffic visualizer / visualiseur de trafic réseau en temps réel",
"main": "main.js",
"license": "AGPL-3.0-or-later",
diff --git a/frontend/index.html b/frontend/index.html
index fe6b310..f181a85 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -18,7 +18,7 @@
/* EN: Global reset + dark base theme.
FR: Reset global + thème sombre de base. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
- body { background: #000000; color: #e2e8f0; font-family: 'Inter', system-ui, sans-serif; overflow: hidden; }
+ body { color: var(--text); font-family: 'Inter', system-ui, sans-serif; overflow: hidden; }
/* EN: Pill scrollbars to match the bento cards — fully rounded thumb
floating on a transparent track, inset by a transparent border so
@@ -26,36 +26,54 @@
FR: Barres de défilement « pilule » assorties aux cartes bento —
curseur entièrement arrondi flottant sur piste transparente, rentré
par une bordure transparente pour un rendu capsule douce. */
- * { scrollbar-width: thin; scrollbar-color: #333333 transparent; }
+ * { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
- background: #333333;
+ background: var(--scrollbar);
border-radius: 8px;
border: 2px solid transparent;
background-clip: padding-box;
}
- ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; border: 2px solid transparent; background-clip: padding-box; }
+ ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-h); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
- /* EN: Light theme — dark UIs get a faithful light variant by inverting
- #root then rotating hue back, so accent colors keep their families
- while surfaces flip to light. Canvases (map, graph, aurora) are
- inverted along with the chrome: the data-viz palette was designed
- for a dark base and still reads correctly inverted.
- FR: Thème clair — l'UI sombre obtient une variante claire fidèle en
- inversant #root puis en ré-ajustant la teinte, donc les accents
- gardent leur famille pendant que les surfaces passent en clair. Les
- canvas (carte, graphe, aurore) sont inversés avec le chrome : la
- palette data-viz conçue sur base sombre reste lisible inversée. */
- html[data-theme="light"] body { background: #e8eaed; }
- html[data-theme="light"] #root {
- filter: invert(0.93) hue-rotate(180deg);
+ /* EN: Design tokens — every component paints through these vars so the
+ whole app flips theme by changing data-theme alone. Dark values are
+ the authored palette; light values are hand-picked equivalents.
+ FR: Tokens de design — chaque composant peint via ces vars, donc
+ l'app entière bascule de thème en changeant data-theme seul. Les
+ valeurs sombres sont la palette d'origine ; les claires sont des
+ équivalents choisis à la main. */
+ html[data-theme="dark"], :root {
+ --bg: #000000; --surface: #0f0f0f; --surface-2: #1c1c1c;
+ --border: #2a2a2a; --scrollbar: #333333; --scrollbar-h: #4a4a4a;
+ --text: #e2e8f0; --text-2: #cbd5e1; --text-dim: #94a3b8;
+ --text-muted: #64748b; --text-faint: #475569;
+ --blue-text: #93c5fd; --red-text: #fca5a5; --green-text: #86efac;
+ --warn-text: #fbbf24;
+ --danger-bg: #2d1b1b; --danger-active: #3b1f2b;
+ --success-active: #153824;
+ --warn-bg: #2d1a00; --info-bg: #0c2340;
+ --map-border: #2d4a6e; --dot-stroke: #0a1628;
+ --aurora-a: #fb923c; --aurora-b: #f472b6; --aurora-c: #e879f9;
}
- /* EN: Native widgets + scrollbars follow the declared scheme.
- FR: Widgets natifs + barres de défilement suivent le schéma déclaré. */
- html[data-theme="light"] { color-scheme: light; }
- html[data-theme="dark"] { color-scheme: dark; }
+ html[data-theme="light"] {
+ --bg: #eef1f5; --surface: #ffffff; --surface-2: #eef1f4;
+ --border: #d9dee5; --scrollbar: #b9c4cf; --scrollbar-h: #8fa0ae;
+ --text: #1e293b; --text-2: #334155; --text-dim: #51617a;
+ --text-muted: #64748b; --text-faint: #94a3b8;
+ --blue-text: #1d4ed8; --red-text: #dc2626; --green-text: #15803d;
+ --warn-text: #b45309;
+ --danger-bg: #fef2f2; --danger-active: #fecdd3;
+ --success-active: #dcfce7;
+ --warn-bg: #fef3c7; --info-bg: #dbeafe;
+ --map-border: #93b8d8; --dot-stroke: #dce9f5;
+ --aurora-a: #fdba74; --aurora-b: #f9a8d4; --aurora-c: #f0abfc;
+ color-scheme: light;
+ }
+ html[data-theme="dark"] { color-scheme: dark; }
+ body { background: var(--bg); }
</style>
<script>
/* EN: Resolve theme before first paint — saved choice wins, else the
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 50dfa13..91a8f16 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -150,7 +150,7 @@ export default function App() {
<AuroraCurtain
bands={5}
noise={0.35}
- colors={['#fb923c', '#f472b6', '#e879f9']}
+ colors={['var(--aurora-a)', 'var(--aurora-b)', 'var(--aurora-c)']}
style={{ height: '100vh', width: '100vw' }}
>
<div style={{ display: 'flex', height: '100%', width: '100%', overflow: 'hidden' }}>
@@ -231,7 +231,7 @@ export default function App() {
}}>
<div style={{
width: '100%', boxSizing: 'border-box',
- background: '#0f0f0f', border: '1px solid #2a2a2a', borderRadius: 12,
+ background: 'var(--surface)', border: '1px solid var(--border)', borderRadius: 12,
}}>
<SearchBar filter={filter} onChange={setFilter} />
</div>
@@ -316,9 +316,9 @@ function ExportButton({ nodes, edges, lanDevices, alerts }) {
button={
<button style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 20, padding: '5px 14px',
- cursor: 'pointer', color: '#64748b',
+ cursor: 'pointer', color: 'var(--text-muted)',
fontSize: 11, fontWeight: 600, transition: 'all 0.15s',
}}>
<Download size={11} />
@@ -329,11 +329,11 @@ function ExportButton({ nodes, edges, lanDevices, alerts }) {
{(close) => items.map(({ label, action }) => (
<button key={label} onClick={() => { action(); close() }} style={{
display: 'block', width: '100%', textAlign: 'left',
- background: 'none', border: 'none', borderBottom: '1px solid #000000',
- padding: '9px 14px', color: '#e2e8f0',
+ background: 'none', border: 'none', borderBottom: '1px solid var(--bg)',
+ padding: '9px 14px', color: 'var(--text)',
fontSize: 11, cursor: 'pointer',
}}
- onMouseEnter={e => e.target.style.background = '#2a2a2a'}
+ onMouseEnter={e => e.target.style.background = 'var(--border)'}
onMouseLeave={e => e.target.style.background = 'none'}>
{label}
</button>
@@ -357,20 +357,20 @@ function MediaBadge({ media }) {
return (
<div style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: '#2d1b1b', border: '1px solid #ef4444',
+ background: 'var(--danger-bg)', border: '1px solid #ef4444',
borderRadius: 20, padding: '5px 12px',
}}>
{micActive && (
<div title={media.mic.join(', ')} style={{ display: 'flex', alignItems: 'center', gap: 4, cursor: 'default' }}>
- <Mic size={11} color="#f87171" />
- <span style={{ fontSize: 10, color: '#fca5a5' }}>{media.mic[0]}</span>
+ <Mic size={11} color="var(--red-text)" />
+ <span style={{ fontSize: 10, color: 'var(--red-text)' }}>{media.mic[0]}</span>
</div>
)}
{micActive && camActive && <span style={{ color: '#4b1f1f', fontSize: 10 }}>|</span>}
{camActive && (
<div title={media.camera.join(', ')} style={{ display: 'flex', alignItems: 'center', gap: 4, cursor: 'default' }}>
- <Camera size={11} color="#f87171" />
- <span style={{ fontSize: 10, color: '#fca5a5' }}>{media.camera[0]}</span>
+ <Camera size={11} color="var(--red-text)" />
+ <span style={{ fontSize: 10, color: 'var(--red-text)' }}>{media.camera[0]}</span>
</div>
)}
</div>
@@ -409,10 +409,10 @@ function ProcessFilter({ excluded, onChange, nodes }) {
button={
<button style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: active ? '#3b1f2b' : '#0f0f0f',
- border: `1px solid ${active ? '#f87171' : '#2a2a2a'}`,
+ background: active ? 'var(--danger-active)' : 'var(--surface)',
+ border: `1px solid ${active ? 'var(--red-text)' : 'var(--border)'}`,
borderRadius: 20, padding: '5px 14px',
- cursor: 'pointer', color: active ? '#fca5a5' : '#64748b',
+ cursor: 'pointer', color: active ? 'var(--red-text)' : 'var(--text-muted)',
fontSize: 11, fontWeight: 600, transition: 'all 0.15s',
}}>
{t('process_filter')}
@@ -425,12 +425,12 @@ function ProcessFilter({ excluded, onChange, nodes }) {
</button>
}
>
- <div style={{ fontSize: 11, color: '#94a3b8', marginBottom: 8 }}>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', marginBottom: 8 }}>
{t('process_filter_hint')}
</div>
{allProcesses.length === 0 && (
- <div style={{ fontSize: 11, color: '#475569' }}>{t('process_none')}</div>
+ <div style={{ fontSize: 11, color: 'var(--text-faint)' }}>{t('process_none')}</div>
)}
{allProcesses.map(proc => {
@@ -439,18 +439,18 @@ function ProcessFilter({ excluded, onChange, nodes }) {
<div key={proc} onClick={() => toggle(proc)} style={{
display: 'flex', alignItems: 'center', gap: 8,
padding: '5px 6px', borderRadius: 6, cursor: 'pointer',
- background: isExcluded ? '#2d1b1b' : 'transparent',
+ background: isExcluded ? 'var(--danger-bg)' : 'transparent',
marginBottom: 2,
}}>
<div style={{
width: 12, height: 12, borderRadius: 3, flexShrink: 0,
- border: `1px solid ${isExcluded ? '#ef4444' : '#475569'}`,
+ border: `1px solid ${isExcluded ? '#ef4444' : 'var(--text-faint)'}`,
background: isExcluded ? '#ef4444' : 'transparent',
display: 'flex', alignItems: 'center', justifyContent: 'center',
}}>
{isExcluded && <span style={{ color: '#fff', fontSize: 9, lineHeight: 1 }}>✕</span>}
</div>
- <span style={{ fontSize: 11, color: isExcluded ? '#fca5a5' : '#e2e8f0' }}>
+ <span style={{ fontSize: 11, color: isExcluded ? 'var(--red-text)' : 'var(--text)' }}>
{proc}
</span>
</div>
@@ -460,8 +460,8 @@ function ProcessFilter({ excluded, onChange, nodes }) {
{active && (
<button onClick={() => onChange([])} style={{
marginTop: 8, width: '100%', background: 'none',
- border: '1px solid #2a2a2a', borderRadius: 6,
- padding: '4px 0', color: '#64748b', fontSize: 10,
+ border: '1px solid var(--border)', borderRadius: 6,
+ padding: '4px 0', color: 'var(--text-muted)', fontSize: 10,
cursor: 'pointer',
}}>
{t('process_clear')}
@@ -500,10 +500,10 @@ function PortFilter({ ports, onUpdate }) {
button={
<button style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: active ? '#1c1c1c' : '#0f0f0f',
- border: `1px solid ${active ? '#3b82f6' : '#2a2a2a'}`,
+ background: active ? 'var(--surface-2)' : 'var(--surface)',
+ border: `1px solid ${active ? '#3b82f6' : 'var(--border)'}`,
borderRadius: 20, padding: '5px 14px',
- cursor: 'pointer', color: active ? '#93c5fd' : '#64748b',
+ cursor: 'pointer', color: active ? 'var(--blue-text)' : 'var(--text-muted)',
fontSize: 11, fontWeight: 600, transition: 'all 0.15s',
}}>
<Filter size={11} />
@@ -517,7 +517,7 @@ function PortFilter({ ports, onUpdate }) {
</button>
}
>
- <div style={{ fontSize: 11, color: '#94a3b8', marginBottom: 8 }}>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', marginBottom: 8 }}>
{active ? `${ports.length} port${ports.length > 1 ? 's' : ''}` : t('port_all')}
</div>
@@ -525,14 +525,14 @@ function PortFilter({ ports, onUpdate }) {
{ports.map(p => (
<span key={p} style={{
display: 'flex', alignItems: 'center', gap: 4,
- background: '#000000', border: '1px solid #3b82f6',
+ background: 'var(--bg)', border: '1px solid #3b82f6',
borderRadius: 12, padding: '2px 8px',
- fontSize: 11, color: '#93c5fd',
+ fontSize: 11, color: 'var(--blue-text)',
}}>
{p}
<button onClick={() => removePort(p)} style={{
background: 'none', border: 'none', cursor: 'pointer',
- color: '#64748b', padding: 0, lineHeight: 1, fontSize: 13,
+ color: 'var(--text-muted)', padding: 0, lineHeight: 1, fontSize: 13,
}}>×</button>
</span>
))}
@@ -545,10 +545,10 @@ function PortFilter({ ports, onUpdate }) {
onChange={e => { setInput(e.target.value); setError(false) }}
placeholder={t('port_placeholder')}
style={{
- flex: 1, background: '#000000',
- border: `1px solid ${error ? '#ef4444' : '#2a2a2a'}`,
+ flex: 1, background: 'var(--bg)',
+ border: `1px solid ${error ? '#ef4444' : 'var(--border)'}`,
borderRadius: 6, padding: '5px 8px',
- color: '#e2e8f0', fontSize: 11, outline: 'none',
+ color: 'var(--text)', fontSize: 11, outline: 'none',
}}
/>
<button type="submit" style={{
@@ -562,8 +562,8 @@ function PortFilter({ ports, onUpdate }) {
{active && (
<button onClick={() => onUpdate([])} style={{
marginTop: 10, width: '100%', background: 'none',
- border: '1px solid #2a2a2a', borderRadius: 6,
- padding: '4px 0', color: '#64748b', fontSize: 10,
+ border: '1px solid var(--border)', borderRadius: 6,
+ padding: '4px 0', color: 'var(--text-muted)', fontSize: 10,
cursor: 'pointer',
}}>
{t('port_all')}
@@ -610,10 +610,10 @@ function IPWhitelist({ ips, onUpdate }) {
button={
<button style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: active ? '#153824' : '#0f0f0f',
- border: `1px solid ${active ? '#22c55e' : '#2a2a2a'}`,
+ background: active ? 'var(--success-active)' : 'var(--surface)',
+ border: `1px solid ${active ? '#22c55e' : 'var(--border)'}`,
borderRadius: 20, padding: '5px 14px',
- cursor: 'pointer', color: active ? '#86efac' : '#64748b',
+ cursor: 'pointer', color: active ? 'var(--green-text)' : 'var(--text-muted)',
fontSize: 11, fontWeight: 600, transition: 'all 0.15s',
}}>
<ShieldOff size={11} />
@@ -627,7 +627,7 @@ function IPWhitelist({ ips, onUpdate }) {
</button>
}
>
- <div style={{ fontSize: 11, color: '#94a3b8', marginBottom: 8 }}>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', marginBottom: 8 }}>
{t('ip_whitelist_hint')}
</div>
@@ -635,14 +635,14 @@ function IPWhitelist({ ips, onUpdate }) {
{ips.map(ip => (
<span key={ip} style={{
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
- background: '#000000', border: '1px solid #22c55e',
+ background: 'var(--bg)', border: '1px solid #22c55e',
borderRadius: 6, padding: '3px 8px',
- fontSize: 11, color: '#86efac', fontFamily: 'monospace',
+ fontSize: 11, color: 'var(--green-text)', fontFamily: 'monospace',
}}>
{ip}
<button onClick={() => removeIp(ip)} style={{
background: 'none', border: 'none', cursor: 'pointer',
- color: '#64748b', padding: 0, lineHeight: 1, fontSize: 13,
+ color: 'var(--text-muted)', padding: 0, lineHeight: 1, fontSize: 13,
}}>×</button>
</span>
))}
@@ -655,10 +655,10 @@ function IPWhitelist({ ips, onUpdate }) {
onChange={e => { setInput(e.target.value); setError(false) }}
placeholder={t('ip_placeholder')}
style={{
- flex: 1, background: '#000000',
- border: `1px solid ${error ? '#ef4444' : '#2a2a2a'}`,
+ flex: 1, background: 'var(--bg)',
+ border: `1px solid ${error ? '#ef4444' : 'var(--border)'}`,
borderRadius: 6, padding: '5px 8px',
- color: '#e2e8f0', fontSize: 11, outline: 'none',
+ color: 'var(--text)', fontSize: 11, outline: 'none',
}}
/>
<button type="submit" style={{
@@ -672,8 +672,8 @@ function IPWhitelist({ ips, onUpdate }) {
{active && (
<button onClick={() => onUpdate([])} style={{
marginTop: 10, width: '100%', background: 'none',
- border: '1px solid #2a2a2a', borderRadius: 6,
- padding: '4px 0', color: '#64748b', fontSize: 10,
+ border: '1px solid var(--border)', borderRadius: 6,
+ padding: '4px 0', color: 'var(--text-muted)', fontSize: 10,
cursor: 'pointer',
}}>
{t('ip_clear')}
@@ -703,11 +703,11 @@ function CaptureToggle({ capturing, onToggle }) {
return (
<button onClick={handleClick} disabled={loading} style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: capturing ? '#0f0f0f' : '#166534',
- border: `1px solid ${capturing ? '#2a2a2a' : '#16a34a'}`,
+ background: capturing ? 'var(--surface)' : '#166534',
+ border: `1px solid ${capturing ? 'var(--border)' : '#16a34a'}`,
borderRadius: 20, padding: '5px 14px',
cursor: loading ? 'wait' : 'pointer',
- color: capturing ? '#f87171' : '#4ade80',
+ color: capturing ? 'var(--red-text)' : '#4ade80',
fontSize: 11, fontWeight: 600,
transition: 'all 0.15s',
opacity: loading ? 0.7 : 1,
@@ -733,12 +733,15 @@ function ThemeToggle() {
document.documentElement.dataset.theme = next
try { localStorage.setItem('snitch_theme', next) } catch (e) { /* ignore */ }
setTheme(next)
+ // EN: Let WebGL/canvas consumers re-resolve their palettes.
+ // FR: Laisser les consommateurs WebGL/canvas re-résoudre leurs palettes.
+ window.dispatchEvent(new Event('snitch-theme'))
}
const Icon = theme === 'dark' ? Sun : Moon
return (
<button onClick={toggle} title={t('theme_toggle')} style={{
- background: '#0f0f0f', border: '1px solid #2a2a2a', borderRadius: 20,
- cursor: 'pointer', color: '#64748b',
+ background: 'var(--surface)', border: '1px solid var(--border)', borderRadius: 20,
+ cursor: 'pointer', color: 'var(--text-muted)',
padding: '5px 10px', display: 'flex', alignItems: 'center',
transition: 'background 0.15s',
}}>
@@ -753,14 +756,14 @@ function LangToggle() {
const { lang, setLang } = useT()
return (
<div style={{
- display: 'flex', background: '#0f0f0f',
- border: '1px solid #2a2a2a', borderRadius: 20, overflow: 'hidden',
+ display: 'flex', background: 'var(--surface)',
+ border: '1px solid var(--border)', borderRadius: 20, overflow: 'hidden',
}}>
{['en', 'fr'].map(l => (
<button key={l} onClick={() => setLang(l)} style={{
background: lang === l ? '#3b82f6' : 'transparent',
border: 'none', cursor: 'pointer',
- color: lang === l ? '#fff' : '#64748b',
+ color: lang === l ? '#fff' : 'var(--text-muted)',
padding: '5px 12px', fontSize: 11, fontWeight: 600,
textTransform: 'uppercase',
transition: 'background 0.15s',
@@ -782,14 +785,14 @@ function ViewToggle({ view, onChange }) {
]
return (
<div style={{
- display: 'flex', background: '#0f0f0f',
- border: '1px solid #2a2a2a', borderRadius: 20, overflow: 'hidden',
+ display: 'flex', background: 'var(--surface)',
+ border: '1px solid var(--border)', borderRadius: 20, overflow: 'hidden',
}}>
{items.map(({ id, Icon, label }) => (
<button key={id} onClick={() => onChange(id)} style={{
background: view === id ? '#3b82f6' : 'transparent',
border: 'none', cursor: 'pointer',
- color: view === id ? '#fff' : '#64748b',
+ color: view === id ? '#fff' : 'var(--text-muted)',
padding: '5px 14px', fontSize: 11, fontWeight: 600,
display: 'flex', alignItems: 'center', gap: 5,
transition: 'background 0.15s',
@@ -814,12 +817,12 @@ function StatusBadge({ status }) {
}
return (
<div style={{
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 20, padding: '5px 14px',
display: 'flex', alignItems: 'center', gap: 8,
}}>
- <div style={{ width: 7, height: 7, borderRadius: '50%', background: colors[status] || '#94a3b8' }} />
- <span style={{ fontSize: 11, color: '#e2e8f0' }}>{labels[status] || status}</span>
+ <div style={{ width: 7, height: 7, borderRadius: '50%', background: colors[status] || 'var(--text-dim)' }} />
+ <span style={{ fontSize: 11, color: 'var(--text)' }}>{labels[status] || status}</span>
</div>
)
}
@@ -838,32 +841,32 @@ function Legend() {
{ Icon: Zap, color: '#6366f1', label: t('legend_cdn') },
{ Icon: Globe, color: '#38bdf8', label: t('legend_dns') },
{ Icon: AlertTriangle, color: '#ef4444', label: t('legend_alert') },
- { Icon: HelpCircle, color: '#94a3b8', label: t('legend_unknown') },
+ { Icon: HelpCircle, color: 'var(--text-dim)', label: t('legend_unknown') },
]
return (
<div style={{
width: '100%', boxSizing: 'border-box',
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 12, padding: '10px 14px',
}}>
{items.map(({ Icon, color, label }) => (
<div key={label} style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}>
<Icon size={12} color={color} />
- <span style={{ fontSize: 10, color: '#94a3b8' }}>{label}</span>
+ <span style={{ fontSize: 10, color: 'var(--text-dim)' }}>{label}</span>
</div>
))}
{/* EN: Edge semantics — the dashed/solid distinction is what tells a
newcomer "seen" from "actually exchanging data".
FR: Sémantique des arêtes — la distinction pointillés/plein dit au
néophyte « vu » versus « échange réel de données ». */}
- <div style={{ borderTop: '1px solid #2a2a2a', marginTop: 6, paddingTop: 6 }}>
+ <div style={{ borderTop: '1px solid var(--border)', marginTop: 6, paddingTop: 6 }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8, marginBottom: 4 }}>
- <span style={{ width: 14, borderTop: '2px solid #64748b', flexShrink: 0 }} />
- <span style={{ fontSize: 9, color: '#64748b' }}>{t('legend_edge_solid')}</span>
+ <span style={{ width: 14, borderTop: '2px solid var(--text-muted)', flexShrink: 0 }} />
+ <span style={{ fontSize: 9, color: 'var(--text-muted)' }}>{t('legend_edge_solid')}</span>
</div>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
- <span style={{ width: 14, borderTop: '2px dashed #64748b', flexShrink: 0 }} />
- <span style={{ fontSize: 9, color: '#64748b' }}>{t('legend_edge_dashed')}</span>
+ <span style={{ width: 14, borderTop: '2px dashed var(--text-muted)', flexShrink: 0 }} />
+ <span style={{ fontSize: 9, color: 'var(--text-muted)' }}>{t('legend_edge_dashed')}</span>
</div>
</div>
{/* EN: Ring semantics — the colored halo around a node is the safety
@@ -873,7 +876,7 @@ function Legend() {
le verdict de sûreté d'un coup d'œil : vert = connu et calme,
orange/rouge pulsant = à regarder. Correspond à
paintAlertRings dans ForceGraph. */}
- <div style={{ borderTop: '1px solid #2a2a2a', marginTop: 6, paddingTop: 6 }}>
+ <div style={{ borderTop: '1px solid var(--border)', marginTop: 6, paddingTop: 6 }}>
{[
{ color: '#22c55e', label: t('legend_ring_safe') },
{ color: '#f59e0b', label: t('legend_ring_warn') },
@@ -883,7 +886,7 @@ function Legend() {
// FR: Une pastille grise en pointillés pour l'ABSENCE d'anneau —
// les appareils non identifiés ou sans particularité ne
// portent aucun verdict.
- { color: '#475569', label: t('legend_ring_none'), dashed: true },
+ { color: 'var(--text-faint)', label: t('legend_ring_none'), dashed: true },
// EN: Dashed orange swatch = the LAN perimeter circle.
// FR: Pastille orange en pointillés = le cercle du périmètre LAN.
{ color: '#f97316', label: t('legend_perimeter'), dashed: true },
@@ -893,7 +896,7 @@ function Legend() {
width: 10, height: 10, borderRadius: '50%', flexShrink: 0,
border: `1.5px ${dashed ? 'dashed' : 'solid'} ${color}`,
}} />
- <span style={{ fontSize: 9, color: '#64748b' }}>{label}</span>
+ <span style={{ fontSize: 9, color: 'var(--text-muted)' }}>{label}</span>
</div>
))}
</div>
diff --git a/frontend/src/components/AlertPanel.jsx b/frontend/src/components/AlertPanel.jsx
index b7636b5..6341fc8 100644
--- a/frontend/src/components/AlertPanel.jsx
+++ b/frontend/src/components/AlertPanel.jsx
@@ -24,9 +24,9 @@ import { useT } from '../i18n'
// EN: Visual style per severity. / FR: Style visuel par sévérité.
const SEVERITY_STYLES = {
- info: { color: '#38bdf8', Icon: Info, bg: '#0c2340' },
- warning: { color: '#f59e0b', Icon: AlertTriangle, bg: '#2d1a00' },
- critical: { color: '#ef4444', Icon: AlertCircle, bg: '#2d0000' },
+ info: { color: '#38bdf8', Icon: Info, bg: 'var(--info-bg)' },
+ warning: { color: '#f59e0b', Icon: AlertTriangle, bg: 'var(--warn-bg)' },
+ critical: { color: '#ef4444', Icon: AlertCircle, bg: 'var(--danger-bg)' },
}
// EN: Per-alert-type icon. / FR: Icône par type d'alerte.
@@ -45,11 +45,11 @@ const TYPE_ICONS = {
export function AlertBell({ unread, onClick }) {
return (
<button onClick={onClick} style={{
- position: 'relative', background: '#0f0f0f',
- border: '1px solid #2a2a2a', borderRadius: 20,
+ position: 'relative', background: 'var(--surface)',
+ border: '1px solid var(--border)', borderRadius: 20,
padding: '5px 14px', cursor: 'pointer',
display: 'flex', alignItems: 'center', gap: 6,
- color: unread > 0 ? '#f59e0b' : '#64748b',
+ color: unread > 0 ? '#f59e0b' : 'var(--text-muted)',
}}>
<Bell size={14} />
{unread > 0 && (
@@ -95,25 +95,25 @@ export function AlertPanel({ alerts, onClose, onIgnore }) {
<div style={{
position: 'absolute', top: 56, right: 16, zIndex: 200,
width: 380, maxHeight: 'calc(100vh - 80px)',
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 12, overflow: 'hidden',
boxShadow: '0 8px 40px rgba(0,0,0,0.6)',
display: 'flex', flexDirection: 'column',
}}>
{/* EN: Header with severity counters / FR: En-tête avec compteurs de sévérité */}
<div style={{
- padding: '14px 18px', borderBottom: '1px solid #2a2a2a',
+ padding: '14px 18px', borderBottom: '1px solid var(--border)',
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
}}>
<div>
- <span style={{ fontWeight: 700, fontSize: 13, color: '#f1f5f9' }}>{t('alerts_title')}</span>
- <span style={{ fontSize: 11, color: '#64748b', marginLeft: 8 }}>{rows.length} {t('alerts_total')}</span>
+ <span style={{ fontWeight: 700, fontSize: 13, color: 'var(--text)' }}>{t('alerts_title')}</span>
+ <span style={{ fontSize: 11, color: 'var(--text-muted)', marginLeft: 8 }}>{rows.length} {t('alerts_total')}</span>
</div>
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
{criticalCount > 0 && <Badge count={criticalCount} color="#ef4444" />}
{warningCount > 0 && <Badge count={warningCount} color="#f59e0b" />}
{infoCount > 0 && <Badge count={infoCount} color="#38bdf8" />}
- <button onClick={onClose} aria-label="Close alerts / Fermer les alertes" style={{ background: 'none', border: 'none', color: '#64748b', cursor: 'pointer' }}>
+ <button onClick={onClose} aria-label="Close alerts / Fermer les alertes" style={{ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer' }}>
<X size={16} />
</button>
</div>
@@ -121,7 +121,7 @@ export function AlertPanel({ alerts, onClose, onIgnore }) {
<div style={{ overflowY: 'auto', flex: 1 }}>
{rows.length === 0 && (
- <div style={{ padding: 32, textAlign: 'center', color: '#64748b', fontSize: 12 }}>
+ <div style={{ padding: 32, textAlign: 'center', color: 'var(--text-muted)', fontSize: 12 }}>
{t('alerts_empty')}
</div>
)}
@@ -159,7 +159,7 @@ function AlertRow({ alert, onIgnore }) {
return (
<div style={{
- padding: '10px 18px', borderBottom: '1px solid #0f0f0f',
+ padding: '10px 18px', borderBottom: '1px solid var(--surface)',
borderLeft: `3px solid ${sev.color}`, background: sev.bg,
}}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 8 }}>
@@ -172,24 +172,24 @@ function AlertRow({ alert, onIgnore }) {
{typeLabel}
</span>
</div>
- <div style={{ fontSize: 11, color: '#e2e8f0', lineHeight: 1.4 }}>{alertMessage(t, alert)}</div>
+ <div style={{ fontSize: 11, color: 'var(--text)', lineHeight: 1.4 }}>{alertMessage(t, alert)}</div>
{alert.details && Object.keys(alert.details).length > 0 && (
- <div style={{ marginTop: 3, fontSize: 9, color: '#64748b', fontFamily: 'monospace' }}>
+ <div style={{ marginTop: 3, fontSize: 9, color: 'var(--text-muted)', fontFamily: 'monospace' }}>
{Object.entries(alert.details).filter(([, v]) => v).map(([k, v]) => `${k}: ${Array.isArray(v) ? v.join(', ') : v}`).join(' · ')}
</div>
)}
{!alert._grouped && onIgnore && (
<button onClick={() => onIgnore(alert)} style={{
- marginTop: 5, background: 'none', border: '1px solid #2a2a2a',
+ marginTop: 5, background: 'none', border: '1px solid var(--border)',
borderRadius: 4, padding: '2px 8px', fontSize: 9,
- color: '#64748b', cursor: 'pointer',
+ color: 'var(--text-muted)', cursor: 'pointer',
}}>
{t('ignore_alert')}
</button>
)}
</div>
</div>
- <span style={{ fontSize: 9, color: '#475569', flexShrink: 0, marginTop: 2 }}>
+ <span style={{ fontSize: 9, color: 'var(--text-faint)', flexShrink: 0, marginTop: 2 }}>
{timeAgo(alert.timestamp, t)}
</span>
</div>
@@ -294,7 +294,7 @@ function Toast({ alert, index, dying }) {
return (
<div style={{
- background: '#0f0f0f', border: `1px solid ${sev.color}44`,
+ background: 'var(--surface)', border: `1px solid ${sev.color}44`,
borderLeft: `3px solid ${sev.color}`,
borderRadius: 6, padding: '5px 10px',
display: 'flex', alignItems: 'center', gap: 8,
@@ -306,7 +306,7 @@ function Toast({ alert, index, dying }) {
<TypeIcon size={12} color={sev.color} style={{ flexShrink: 0 }} />
<div style={{ minWidth: 0 }}>
<div style={{ fontSize: 9, color: sev.color, fontWeight: 700, textTransform: 'uppercase' }}>{typeLabel}</div>
- <div style={{ fontSize: 10, color: '#94a3b8', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{alertMessage(t, alert)}</div>
+ <div style={{ fontSize: 10, color: 'var(--text-dim)', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{alertMessage(t, alert)}</div>
</div>
</div>
)
diff --git a/frontend/src/components/AppsView.jsx b/frontend/src/components/AppsView.jsx
index 6bd0020..a5af40f 100644
--- a/frontend/src/components/AppsView.jsx
+++ b/frontend/src/components/AppsView.jsx
@@ -58,7 +58,7 @@ export default function AppsView({ nodes }) {
}, [expanded])
if (apps.length === 0) {
- return <div style={{ padding: 40, textAlign: 'center', color: '#64748b', fontSize: 12 }}>{t('apps_empty')}</div>
+ return <div style={{ padding: 40, textAlign: 'center', color: 'var(--text-muted)', fontSize: 12 }}>{t('apps_empty')}</div>
}
const maxBytes = apps[0].bytes || 1
@@ -70,7 +70,7 @@ export default function AppsView({ nodes }) {
<div style={{ height: '100%', overflowY: 'auto', padding: '56px 24px 16px' }}>
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 12 }}>
<thead>
- <tr style={{ color: '#64748b', fontSize: 10, textTransform: 'uppercase', letterSpacing: 0.5 }}>
+ <tr style={{ color: 'var(--text-muted)', fontSize: 10, textTransform: 'uppercase', letterSpacing: 0.5 }}>
<th style={{ textAlign: 'left', padding: '6px 8px' }}>{t('apps_process')}</th>
<th style={{ textAlign: 'right', padding: '6px 8px' }}>{t('apps_destinations')}</th>
<th style={{ textAlign: 'right', padding: '6px 8px' }}>{t('apps_packets')}</th>
@@ -82,9 +82,9 @@ export default function AppsView({ nodes }) {
<Fragment key={app.name}>
<tr
onClick={() => setExpanded(expanded === app.name ? null : app.name)}
- style={{ cursor: 'pointer', borderTop: '1px solid #0f0f0f' }}
+ style={{ cursor: 'pointer', borderTop: '1px solid var(--surface)' }}
>
- <td style={{ padding: '8px', color: '#e2e8f0', fontFamily: 'monospace' }}>
+ <td style={{ padding: '8px', color: 'var(--text)', fontFamily: 'monospace' }}>
{(() => {
const Icon = processIcon(app.name)
return (
@@ -95,30 +95,30 @@ export default function AppsView({ nodes }) {
)
})()}
</td>
- <td style={{ padding: '8px', textAlign: 'right', color: '#94a3b8' }}>{app.destinations.length}</td>
- <td style={{ padding: '8px', textAlign: 'right', color: '#94a3b8' }}>{app.packets}</td>
+ <td style={{ padding: '8px', textAlign: 'right', color: 'var(--text-dim)' }}>{app.destinations.length}</td>
+ <td style={{ padding: '8px', textAlign: 'right', color: 'var(--text-dim)' }}>{app.packets}</td>
<td style={{ padding: '8px' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
- <div style={{ flex: 1, height: 6, background: '#000000', borderRadius: 3, overflow: 'hidden' }}>
+ <div style={{ flex: 1, height: 6, background: 'var(--bg)', borderRadius: 3, overflow: 'hidden' }}>
<div style={{ width: `${(app.bytes / maxBytes) * 100}%`, height: '100%', background: '#3b82f6' }} />
</div>
- <span style={{ color: '#94a3b8', minWidth: 60, textAlign: 'right' }}>{fmtBytes(app.bytes)}</span>
+ <span style={{ color: 'var(--text-dim)', minWidth: 60, textAlign: 'right' }}>{fmtBytes(app.bytes)}</span>
</div>
</td>
</tr>
{expanded === app.name && (
<tr>
- <td colSpan={4} style={{ padding: '8px 8px 16px 24px', background: '#000000' }}>
- <div style={{ fontSize: 10, color: '#64748b', marginBottom: 6 }}>{t('apps_top_dest')}</div>
+ <td colSpan={4} style={{ padding: '8px 8px 16px 24px', background: 'var(--bg)' }}>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)', marginBottom: 6 }}>{t('apps_top_dest')}</div>
{app.destinations.slice(0, 5).map(d => (
- <div key={d.ip} style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11, color: '#94a3b8', padding: '2px 0' }}>
+ <div key={d.ip} style={{ display: 'flex', justifyContent: 'space-between', fontSize: 11, color: 'var(--text-dim)', padding: '2px 0' }}>
<span style={{ fontFamily: 'monospace' }}>{d.label || d.ip}</span>
<span>{fmtBytes(d.bytes)}</span>
</div>
))}
{history.length > 0 && (
<>
- <div style={{ fontSize: 10, color: '#64748b', margin: '10px 0 6px' }}>{t('apps_history_60m')}</div>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)', margin: '10px 0 6px' }}>{t('apps_history_60m')}</div>
<div style={{ display: 'flex', alignItems: 'flex-end', gap: 2, height: 40 }}>
{history.slice(-30).map((h, i) => (
<div key={i} title={`${h.minute} — ${fmtBytes(h.bytes)}`}
diff --git a/frontend/src/components/AuroraCurtain.jsx b/frontend/src/components/AuroraCurtain.jsx
index 5ddaf78..8db858b 100644
--- a/frontend/src/components/AuroraCurtain.jsx
+++ b/frontend/src/components/AuroraCurtain.jsx
@@ -18,6 +18,7 @@
*/
import { useEffect, useRef, useState } from "react";
+import { useTheme } from "../theme.js";
// EN: Cap the backing store at 1.5× — retina-full-screen × 5 ribbons is a
// real GPU load (it visibly froze video calls); the re-seeded grain
@@ -471,12 +472,16 @@ export default function AuroraCurtain({
const colorKey = colors.join("|");
const grain = resolveGrain(noise);
+ // EN: var(--token) inputs resolve differently per theme — re-probe on flip.
+ // FR: Les entrées var(--token) se résolvent différemment par thème —
+ // re-sonder à chaque bascule.
+ const theme = useTheme();
useEffect(() => {
const host = hostRef.current;
if (!host) return;
setResolvedColors(resolveCssColors(colorKey.split("|"), host));
- }, [colorKey]);
+ }, [colorKey, theme]);
useEffect(() => {
const canvas = canvasRef.current;
diff --git a/frontend/src/components/BandwidthChart.jsx b/frontend/src/components/BandwidthChart.jsx
index 4aef13e..1500a28 100644
--- a/frontend/src/components/BandwidthChart.jsx
+++ b/frontend/src/components/BandwidthChart.jsx
@@ -46,9 +46,9 @@ export default function BandwidthChart({ data }) {
const area = d3.area().x(d => x(d.ts)).y0(H).y1(d => y(d.bps)).curve(d3.curveCatmullRom)
const line = d3.line().x(d => x(d.ts)).y(d => y(d.bps)).curve(d3.curveCatmullRom)
- svg.append('path').datum(data).attr('d', area).attr('fill', 'url(#bw-grad)')
+ svg.append('path').datum(data).attr('d', area).style('fill', 'url(#bw-grad)')
svg.append('path').datum(data).attr('d', line)
- .attr('fill', 'none').attr('stroke', '#3b82f6').attr('stroke-width', 1.5)
+ .style('fill', 'none').style('stroke', '#3b82f6').style('stroke-width', 1.5)
}
// EN: Current throughput label, right-aligned.
@@ -57,7 +57,7 @@ export default function BandwidthChart({ data }) {
svg.append('text')
.attr('x', W - 2).attr('y', 11)
.attr('text-anchor', 'end')
- .attr('fill', current > 0 ? '#3b82f6' : '#2a2a2a')
+ .style('fill', current > 0 ? '#3b82f6' : 'var(--border)')
.attr('font-size', 9).attr('font-weight', 700)
.text(fmtBps(current))
}, [data])
diff --git a/frontend/src/components/Dropdown.jsx b/frontend/src/components/Dropdown.jsx
index f46cad2..bdfcc34 100644
--- a/frontend/src/components/Dropdown.jsx
+++ b/frontend/src/components/Dropdown.jsx
@@ -56,7 +56,7 @@ export default function Dropdown({ button, children, panelStyle }) {
{open && (
<div style={{
position: 'absolute', top: '110%', right: 0, zIndex: 100,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 10, minWidth: 180,
boxShadow: '0 8px 24px rgba(0,0,0,0.4)',
...panelStyle,
diff --git a/frontend/src/components/Onboarding.jsx b/frontend/src/components/Onboarding.jsx
index bcae66b..80863cb 100644
--- a/frontend/src/components/Onboarding.jsx
+++ b/frontend/src/components/Onboarding.jsx
@@ -33,38 +33,38 @@ export default function Onboarding({ onDone }) {
display: 'flex', alignItems: 'center', justifyContent: 'center',
}}>
<div style={{
- width: 440, background: '#0f0f0f', border: '1px solid #2a2a2a',
+ width: 440, background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 14, padding: '28px 28px 20px',
boxShadow: '0 20px 60px rgba(0,0,0,0.7)',
}}>
- <div style={{ fontSize: 18, fontWeight: 700, color: '#f1f5f9', marginBottom: 4 }}>
+ <div style={{ fontSize: 18, fontWeight: 700, color: 'var(--text)', marginBottom: 4 }}>
{t('onboard_title')}
</div>
- <div style={{ fontSize: 12, color: '#94a3b8', marginBottom: 20 }}>
+ <div style={{ fontSize: 12, color: 'var(--text-dim)', marginBottom: 20 }}>
{t('onboard_sub')}
</div>
<div style={item}>
<ShieldCheck size={18} color="#22c55e" style={{ flexShrink: 0, marginTop: 1 }} />
<div>
- <div style={{ fontSize: 12, fontWeight: 600, color: '#e2e8f0' }}>{t('onboard_priv_title')}</div>
- <div style={{ fontSize: 11, color: '#94a3b8', lineHeight: 1.5 }}>{t('onboard_priv_body')}</div>
+ <div style={{ fontSize: 12, fontWeight: 600, color: 'var(--text)' }}>{t('onboard_priv_title')}</div>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', lineHeight: 1.5 }}>{t('onboard_priv_body')}</div>
</div>
</div>
<div style={item}>
<Eye size={18} color="#38bdf8" style={{ flexShrink: 0, marginTop: 1 }} />
<div>
- <div style={{ fontSize: 12, fontWeight: 600, color: '#e2e8f0' }}>{t('onboard_capture_title')}</div>
- <div style={{ fontSize: 11, color: '#94a3b8', lineHeight: 1.5 }}>{t('onboard_capture_body')}</div>
+ <div style={{ fontSize: 12, fontWeight: 600, color: 'var(--text)' }}>{t('onboard_capture_title')}</div>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', lineHeight: 1.5 }}>{t('onboard_capture_body')}</div>
</div>
</div>
<div style={item}>
<Download size={18} color="#f59e0b" style={{ flexShrink: 0, marginTop: 1 }} />
<div>
- <div style={{ fontSize: 12, fontWeight: 600, color: '#e2e8f0' }}>{t('onboard_out_title')}</div>
- <div style={{ fontSize: 11, color: '#94a3b8', lineHeight: 1.5 }}>{t('onboard_out_body')}</div>
+ <div style={{ fontSize: 12, fontWeight: 600, color: 'var(--text)' }}>{t('onboard_out_title')}</div>
+ <div style={{ fontSize: 11, color: 'var(--text-dim)', lineHeight: 1.5 }}>{t('onboard_out_body')}</div>
</div>
</div>
diff --git a/frontend/src/components/PrivacyScore.jsx b/frontend/src/components/PrivacyScore.jsx
index 7f8f309..0b62176 100644
--- a/frontend/src/components/PrivacyScore.jsx
+++ b/frontend/src/components/PrivacyScore.jsx
@@ -42,7 +42,7 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
return (
<div style={{ padding: '14px 16px' }}>
- <div style={{ fontSize: 10, color: '#64748b', textTransform: 'uppercase', letterSpacing: 1, marginBottom: 10 }}>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)', textTransform: 'uppercase', letterSpacing: 1, marginBottom: 10 }}>
{t('privacy_title')}
</div>
@@ -51,7 +51,7 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
FR: Donut — longueur d'arc proportionnelle au score. */}
<div style={{ flexShrink: 0 }}>
<svg width={84} height={84}>
- <circle cx={42} cy={42} r={R} fill="none" stroke="#1c1c1c" strokeWidth={STROKE} />
+ <circle cx={42} cy={42} r={R} fill="none" stroke="var(--surface-2)" strokeWidth={STROKE} />
<circle
cx={42} cy={42} r={R}
fill="none" stroke={color} strokeWidth={STROKE}
@@ -70,7 +70,7 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
<div style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 13, fontWeight: 700, color, marginBottom: 2 }}>{t(labelKey)}</div>
- <div style={{ fontSize: 10, color: '#64748b', marginBottom: 8 }}>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)', marginBottom: 8 }}>
{t('privacy_risk_factors', badCount)}
</div>
@@ -80,9 +80,9 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
const Icon = SCORE_ICONS[f.icon]
return (
<div key={i} style={{ display: 'flex', alignItems: 'center', gap: 6, marginBottom: 4 }}>
- {Icon && <Icon size={12} color={f.bad ? '#94a3b8' : '#22c55e'} />}
+ {Icon && <Icon size={12} color={f.bad ? 'var(--text-dim)' : '#22c55e'} />}
<span style={{
- fontSize: 10, color: f.bad ? '#cbd5e1' : '#64748b',
+ fontSize: 10, color: f.bad ? 'var(--text-2)' : 'var(--text-muted)',
flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap',
}}>
{t(f.key, ...f.args)}
@@ -95,7 +95,7 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
})}
{factors.length > 3 && (
- <div style={{ fontSize: 9, color: '#475569', marginTop: 2 }}>
+ <div style={{ fontSize: 9, color: 'var(--text-faint)', marginTop: 2 }}>
{t('privacy_more_factors', factors.length - 3)}
</div>
)}
@@ -114,7 +114,7 @@ export default function PrivacyScore({ score, grade, color, labelKey, factors })
position: 'absolute', left: `${score}%`, top: '50%',
transform: 'translate(-50%, -50%)',
width: 10, height: 10, borderRadius: '50%',
- background: color, border: '2px solid #000000',
+ background: color, border: '2px solid var(--bg)',
boxShadow: `0 0 6px ${color}`,
transition: 'left 0.6s ease',
}} />
diff --git a/frontend/src/components/SearchBar.jsx b/frontend/src/components/SearchBar.jsx
index 519ac76..c82f505 100644
--- a/frontend/src/components/SearchBar.jsx
+++ b/frontend/src/components/SearchBar.jsx
@@ -16,12 +16,12 @@ import { useT } from '../i18n'
// FR: Puces de catégorie — `label` est un nom de service anglais fixe, sinon
// la puce utilise une clé i18n.
const CATEGORY_IDS = [
- { id: 'all', color: '#64748b' },
+ { id: 'all', color: 'var(--text-muted)' },
{ id: 'safe', label: 'HTTPS', color: '#22c55e' },
{ id: 'tracking', label: 'Tracking', color: '#f59e0b' },
{ id: 'cdn', label: 'CDN', color: '#6366f1' },
{ id: 'dns', label: 'DNS', color: '#38bdf8' },
- { id: 'unknown', color: '#94a3b8' },
+ { id: 'unknown', color: 'var(--text-dim)' },
{ id: 'alerted', color: '#ef4444' },
]
@@ -42,7 +42,7 @@ export default function SearchBar({ filter, onChange }) {
<div style={{ position: 'relative', marginBottom: 7 }}>
<Search size={11} style={{
position: 'absolute', left: 8, top: '50%',
- transform: 'translateY(-50%)', color: '#64748b', pointerEvents: 'none',
+ transform: 'translateY(-50%)', color: 'var(--text-muted)', pointerEvents: 'none',
}} />
<input
value={text}
@@ -50,15 +50,15 @@ export default function SearchBar({ filter, onChange }) {
placeholder={t('search_placeholder')}
style={{
width: '100%', boxSizing: 'border-box',
- background: '#000000', border: '1px solid #2a2a2a',
+ background: 'var(--bg)', border: '1px solid var(--border)',
borderRadius: 6, padding: '5px 26px 5px 26px',
- color: '#e2e8f0', fontSize: 11, outline: 'none',
+ color: 'var(--text)', fontSize: 11, outline: 'none',
}}
/>
{text && (
<button onClick={() => onChange({ ...filter, text: '' })} style={{
position: 'absolute', right: 6, top: '50%', transform: 'translateY(-50%)',
- background: 'none', border: 'none', color: '#64748b', cursor: 'pointer', padding: 0,
+ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer', padding: 0,
}}>
<X size={11} />
</button>
@@ -70,10 +70,10 @@ export default function SearchBar({ filter, onChange }) {
{categories.map(c => (
<button key={c.id} onClick={() => onChange({ ...filter, category: c.id })} style={{
background: category === c.id ? c.color + '22' : 'transparent',
- border: `1px solid ${category === c.id ? c.color : '#2a2a2a'}`,
+ border: `1px solid ${category === c.id ? c.color : 'var(--border)'}`,
borderRadius: 10, padding: '2px 8px',
fontSize: 9, fontWeight: 600,
- color: category === c.id ? c.color : '#64748b',
+ color: category === c.id ? c.color : 'var(--text-muted)',
cursor: 'pointer', transition: 'all 0.15s',
}}>
{c.label}
diff --git a/frontend/src/components/Settings.jsx b/frontend/src/components/Settings.jsx
index 126b288..5f0a59b 100644
--- a/frontend/src/components/Settings.jsx
+++ b/frontend/src/components/Settings.jsx
@@ -21,9 +21,9 @@ export function SettingsButton({ onClick }) {
return (
<button onClick={onClick} aria-label="Settings / Réglages" style={{
display: 'flex', alignItems: 'center', gap: 6,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 20, padding: '5px 14px',
- cursor: 'pointer', color: '#64748b',
+ cursor: 'pointer', color: 'var(--text-muted)',
fontSize: 11, fontWeight: 600,
}}>
<SettingsIcon size={11} />
@@ -102,28 +102,28 @@ export function SettingsPanel({ onClose, lang, setLang }) {
URL.revokeObjectURL(a.href)
}
- const row = { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '10px 0', borderBottom: '1px solid #000000' }
- const label = { fontSize: 12, color: '#e2e8f0', fontWeight: 600 }
- const hint = { fontSize: 10, color: '#64748b', marginTop: 2 }
+ const row = { display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '10px 0', borderBottom: '1px solid var(--bg)' }
+ const label = { fontSize: 12, color: 'var(--text)', fontWeight: 600 }
+ const hint = { fontSize: 10, color: 'var(--text-muted)', marginTop: 2 }
return (
<div role="dialog" aria-label="Settings / Réglages" style={{
position: 'absolute', top: 56, right: 16, zIndex: 200,
width: 380, maxHeight: 'calc(100vh - 80px)',
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 12, overflow: 'hidden auto',
boxShadow: '0 8px 40px rgba(0,0,0,0.6)',
display: 'flex', flexDirection: 'column',
}}>
<div style={{
- padding: '14px 18px', borderBottom: '1px solid #2a2a2a',
+ padding: '14px 18px', borderBottom: '1px solid var(--border)',
display: 'flex', justifyContent: 'space-between', alignItems: 'center',
- position: 'sticky', top: 0, background: '#0f0f0f', zIndex: 1,
+ position: 'sticky', top: 0, background: 'var(--surface)', zIndex: 1,
}}>
- <span style={{ fontWeight: 700, fontSize: 13, color: '#f1f5f9' }}>{t('settings_title')}</span>
+ <span style={{ fontWeight: 700, fontSize: 13, color: 'var(--text)' }}>{t('settings_title')}</span>
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
{saved && <span style={{ fontSize: 10, color: '#4ade80' }}>{t('settings_saved')}</span>}
- <button onClick={onClose} aria-label={t('close')} style={{ background: 'none', border: 'none', color: '#64748b', cursor: 'pointer' }}>
+ <button onClick={onClose} aria-label={t('close')} style={{ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer' }}>
<X size={16} />
</button>
</div>
@@ -136,9 +136,9 @@ export function SettingsPanel({ onClose, lang, setLang }) {
<div style={{ display: 'flex', gap: 4 }}>
{['en', 'fr'].map(l => (
<button key={l} onClick={() => { setLang(l); save('language', l) }} style={{
- background: lang === l ? '#3b82f6' : '#000000',
- border: '1px solid #2a2a2a', borderRadius: 6,
- color: lang === l ? '#fff' : '#64748b',
+ background: lang === l ? '#3b82f6' : 'var(--bg)',
+ border: '1px solid var(--border)', borderRadius: 6,
+ color: lang === l ? '#fff' : 'var(--text-muted)',
padding: '4px 12px', fontSize: 11, cursor: 'pointer',
textTransform: 'uppercase', fontWeight: 600,
}}>{l}</button>
@@ -155,7 +155,7 @@ export function SettingsPanel({ onClose, lang, setLang }) {
<select
value={retention}
onChange={e => { const v = +e.target.value; setRetention(v); save('retention_hours', v) }}
- style={{ background: '#000000', border: '1px solid #2a2a2a', borderRadius: 6, color: '#e2e8f0', padding: '4px 8px', fontSize: 11 }}
+ style={{ background: 'var(--bg)', border: '1px solid var(--border)', borderRadius: 6, color: 'var(--text)', padding: '4px 8px', fontSize: 11 }}
>
{[6, 12, 24, 48, 72, 168].map(h => <option key={h} value={h}>{h}h</option>)}
</select>
@@ -172,12 +172,12 @@ export function SettingsPanel({ onClose, lang, setLang }) {
role="switch" aria-checked={autoLaunch}
style={{
width: 36, height: 20, borderRadius: 10, border: 'none',
- background: autoLaunch ? '#3b82f6' : '#000000',
- outline: '1px solid #2a2a2a', cursor: 'pointer',
+ background: autoLaunch ? '#3b82f6' : 'var(--bg)',
+ outline: '1px solid var(--border)', cursor: 'pointer',
position: 'relative', flexShrink: 0,
}}>
<div style={{
- width: 14, height: 14, borderRadius: '50%', background: '#e2e8f0',
+ width: 14, height: 14, borderRadius: '50%', background: 'var(--text)',
position: 'absolute', top: 3, left: autoLaunch ? 19 : 3,
transition: 'left 0.15s',
}} />
@@ -195,13 +195,13 @@ export function SettingsPanel({ onClose, lang, setLang }) {
</div>
<button onClick={downloadGeo} style={{
marginTop: 8, display: 'flex', alignItems: 'center', gap: 6,
- background: '#000000', border: '1px solid #3b82f6', borderRadius: 6,
- color: '#93c5fd', padding: '6px 12px', fontSize: 11, cursor: 'pointer',
+ background: 'var(--bg)', border: '1px solid #3b82f6', borderRadius: 6,
+ color: 'var(--blue-text)', padding: '6px 12px', fontSize: 11, cursor: 'pointer',
}}>
<Download size={11} /> {t('geo_download_btn')}
</button>
<div style={{ ...hint, marginTop: 4 }}>{t('geo_consent')}</div>
- {geoMsg && <div style={{ fontSize: 10, color: '#93c5fd', marginTop: 4 }}>{geoMsg}</div>}
+ {geoMsg && <div style={{ fontSize: 10, color: 'var(--blue-text)', marginTop: 4 }}>{geoMsg}</div>}
</div>
{/* Diagnostics / Diagnostic */}
@@ -213,23 +213,23 @@ export function SettingsPanel({ onClose, lang, setLang }) {
<div style={{ display: 'flex', gap: 6 }}>
{window.snitch?.openLogs && (
<button onClick={openLogs} aria-label={t('diag_open_logs')} style={{
- background: '#000000', border: '1px solid #2a2a2a', borderRadius: 6,
- color: '#94a3b8', padding: '5px 10px', fontSize: 11, cursor: 'pointer',
+ background: 'var(--bg)', border: '1px solid var(--border)', borderRadius: 6,
+ color: 'var(--text-dim)', padding: '5px 10px', fontSize: 11, cursor: 'pointer',
display: 'flex', alignItems: 'center', gap: 4,
}}>
<FolderOpen size={11} /> {t('diag_open_logs')}
</button>
)}
<button onClick={exportDiagnostics} style={{
- background: '#000000', border: '1px solid #2a2a2a', borderRadius: 6,
- color: '#94a3b8', padding: '5px 10px', fontSize: 11, cursor: 'pointer',
+ background: 'var(--bg)', border: '1px solid var(--border)', borderRadius: 6,
+ color: 'var(--text-dim)', padding: '5px 10px', fontSize: 11, cursor: 'pointer',
}}>
{t('diag_export')}
</button>
</div>
</div>
- <div style={{ fontSize: 10, color: '#475569', marginTop: 12, display: 'flex', alignItems: 'center', gap: 4 }}>
+ <div style={{ fontSize: 10, color: 'var(--text-faint)', marginTop: 12, display: 'flex', alignItems: 'center', gap: 4 }}>
<ShieldCheck size={11} /> {t('settings_note')}
</div>
</div>
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 0ca9d64..00af28c 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -28,7 +28,7 @@ const DEVICE_ICONS = {
// FR: Couleur de point par catégorie de trafic — reflète le classifieur backend.
const CATEGORY_COLORS = {
safe: '#22c55e', tracking: '#f59e0b', cdn: '#6366f1',
- dns: '#38bdf8', admin: '#fb923c', unknown: '#94a3b8', local: '#3b82f6',
+ dns: '#38bdf8', admin: '#fb923c', unknown: 'var(--text-dim)', local: '#3b82f6',
}
/**
@@ -117,9 +117,9 @@ export default function Sidebar({ nodes, lanDevices, packets, selected, onClose,
{/* EN: Snitch mark — the white radar-eye sigil.
FR: Emblème Snitch — le sigle radar-œil blanc. */}
<img src="./logo.png" alt="Snitch" style={{ width: 22, height: 22, borderRadius: 5 }} />
- <span style={{ fontSize: 17, fontWeight: 800, color: '#f1f5f9', letterSpacing: 1 }}>{t('app_name')}</span>
+ <span style={{ fontSize: 17, fontWeight: 800, color: 'var(--text)', letterSpacing: 1 }}>{t('app_name')}</span>
</div>
- <span style={{ fontSize: 10, color: '#475569', letterSpacing: 1 }}>{t('tagline')}</span>
+ <span style={{ fontSize: 10, color: 'var(--text-faint)', letterSpacing: 1 }}>{t('tagline')}</span>
</div>
{privacyScore && (
@@ -149,10 +149,10 @@ export default function Sidebar({ nodes, lanDevices, packets, selected, onClose,
{selected && (
<div style={{ ...CARD, padding: '12px 16px' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 6 }}>
- <span style={{ fontSize: 12, fontWeight: 600, color: '#f1f5f9' }}>
+ <span style={{ fontSize: 12, fontWeight: 600, color: 'var(--text)' }}>
{nodeName(selected, t)}
</span>
- <button onClick={onClose} style={{ background: 'none', border: 'none', color: '#64748b', cursor: 'pointer', fontSize: 16 }}>x</button>
+ <button onClick={onClose} style={{ background: 'none', border: 'none', color: 'var(--text-muted)', cursor: 'pointer', fontSize: 16 }}>x</button>
</div>
<NodeDetail node={selected} onWhitelist={onWhitelist} />
</div>
@@ -168,7 +168,7 @@ export default function Sidebar({ nodes, lanDevices, packets, selected, onClose,
<SectionTitle label={t('section_ext', filteredNodes.length, hiddenCount)} />
{filteredNodes.length === 0 && (
- <div style={{ padding: '10px 20px', fontSize: 10, color: '#475569', fontStyle: 'italic' }}>
+ <div style={{ padding: '10px 20px', fontSize: 10, color: 'var(--text-faint)', fontStyle: 'italic' }}>
{t('ext_empty')}
</div>
)}
@@ -189,7 +189,7 @@ export default function Sidebar({ nodes, lanDevices, packets, selected, onClose,
traitement libre que le bloc marque, sans carte. */}
<div style={{ padding: '0 8px 4px', textAlign: 'center', flexShrink: 0 }}>
<a href="https://aixis.fr/" target="_blank" rel="noopener noreferrer" style={{
- fontSize: 9, color: '#475569', textDecoration: 'none', letterSpacing: 0.5,
+ fontSize: 9, color: 'var(--text-faint)', textDecoration: 'none', letterSpacing: 0.5,
}}>
{t('footer_credit')} · aixis.fr
</a>
@@ -201,14 +201,14 @@ export default function Sidebar({ nodes, lanDevices, packets, selected, onClose,
/** EN: Bento card chrome — near-black fill, hairline border, 12px radius.
* FR: Habillage carte bento — fond quasi noir, bordure fine, rayon 12 px. */
const CARD = {
- background: '#0f0f0f', border: '1px solid #1c1c1c',
+ background: 'var(--surface)', border: '1px solid var(--surface-2)',
borderRadius: 12,
}
/** EN: Sticky list section header. / FR: En-tête de section de liste collant. */
function SectionTitle({ label }) {
return (
- <div style={{ padding: '6px 16px 4px', fontSize: 10, color: '#64748b', textTransform: 'uppercase', letterSpacing: 1, background: '#0f0f0f', position: 'sticky', top: 0, borderRadius: '12px 12px 0 0' }}>
+ <div style={{ padding: '6px 16px 4px', fontSize: 10, color: 'var(--text-muted)', textTransform: 'uppercase', letterSpacing: 1, background: 'var(--surface)', position: 'sticky', top: 0, borderRadius: '12px 12px 0 0' }}>
{label}
</div>
)
@@ -217,8 +217,8 @@ function SectionTitle({ label }) {
function Stat({ label, value, color }) {
return (
<div style={{ textAlign: 'center' }}>
- <div style={{ fontSize: 16, fontWeight: 700, color: color || '#f1f5f9' }}>{value}</div>
- <div style={{ fontSize: 10, color: '#64748b' }}>{label}</div>
+ <div style={{ fontSize: 16, fontWeight: 700, color: color || 'var(--text)' }}>{value}</div>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)' }}>{label}</div>
</div>
)
}
@@ -226,11 +226,11 @@ function Stat({ label, value, color }) {
/** EN: Small explanatory note in the detail card — muted box, coloured
* left border. / FR: Petite note explicative dans la fiche détail —
* cadre discret, bordure gauche colorée. */
-function Hint({ children, accent = '#2a2a2a' }) {
+function Hint({ children, accent = 'var(--border)' }) {
return (
<div style={{
marginTop: 8, padding: '6px 8px', fontSize: 9, lineHeight: 1.5,
- color: '#64748b', background: '#000000', borderRadius: 6,
+ color: 'var(--text-muted)', background: 'var(--bg)', borderRadius: 6,
borderLeft: `2px solid ${accent}`,
}}>
{children}
@@ -245,18 +245,18 @@ function DeviceRow({ device }) {
return (
<div style={{
padding: '7px 16px', display: 'flex', alignItems: 'center', gap: 8,
- borderBottom: '1px solid #1a1a1a',
+ borderBottom: '1px solid var(--surface-2)',
opacity: device.online === false ? 0.45 : 1,
}}>
<Icon size={16} color={device.color} />
<div style={{ flex: 1, minWidth: 0 }}>
- <div style={{ fontSize: 11, fontWeight: 600, color: '#e2e8f0', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
+ <div style={{ fontSize: 11, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{device.hostname || device.vendor || device.ip}
{!device.hostname && !device.vendor && (
- <span style={{ fontSize: 9, color: '#475569', fontWeight: 400 }}> · {t('unidentified')}</span>
+ <span style={{ fontSize: 9, color: 'var(--text-faint)', fontWeight: 400 }}> · {t('unidentified')}</span>
)}
</div>
- <div style={{ fontSize: 9, color: '#64748b', fontFamily: 'monospace' }}>
+ <div style={{ fontSize: 9, color: 'var(--text-muted)', fontFamily: 'monospace' }}>
{/* EN: Type first — "Routeur · 192.168.1.254" tells a neophyte more
than a bare MAC address does.
FR: Le type d'abord — « Routeur · 192.168.1.254 » dit plus à un
@@ -275,15 +275,15 @@ function DeviceRow({ device }) {
function NodeRow({ node }) {
const { t } = useT()
return (
- <div style={{ padding: '6px 16px', display: 'flex', alignItems: 'center', gap: 8, borderBottom: '1px solid #1a1a1a' }}>
- <div style={{ width: 7, height: 7, borderRadius: '50%', background: CATEGORY_COLORS[node.category] || '#94a3b8', flexShrink: 0 }} />
+ <div style={{ padding: '6px 16px', display: 'flex', alignItems: 'center', gap: 8, borderBottom: '1px solid var(--surface-2)' }}>
+ <div style={{ width: 7, height: 7, borderRadius: '50%', background: CATEGORY_COLORS[node.category] || 'var(--text-dim)', flexShrink: 0 }} />
<div style={{ flex: 1, minWidth: 0 }}>
- <div style={{ fontSize: 11, color: '#e2e8f0', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
+ <div style={{ fontSize: 11, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{nodeName(node, t)}
</div>
- <div style={{ fontSize: 9, color: '#64748b' }}>{node.country || '-'} · {node.packets || 0} pkt</div>
+ <div style={{ fontSize: 9, color: 'var(--text-muted)' }}>{node.country || '-'} · {node.packets || 0} pkt</div>
</div>
- <div style={{ fontSize: 10, color: '#94a3b8', flexShrink: 0 }}>{fmt(node.bytes || 0)}</div>
+ <div style={{ fontSize: 10, color: 'var(--text-dim)', flexShrink: 0 }}>{fmt(node.bytes || 0)}</div>
</div>
)
}
@@ -326,8 +326,8 @@ function NodeDetail({ node, onWhitelist }) {
<div>
{fields.filter(([, v]) => v != null && v !== '').map(([k, v]) => (
<div key={k} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 3 }}>
- <span style={{ fontSize: 10, color: '#64748b' }}>{k}</span>
- <span style={{ fontSize: 10, color: '#e2e8f0', maxWidth: 170, textAlign: 'right', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{v}</span>
+ <span style={{ fontSize: 10, color: 'var(--text-muted)' }}>{k}</span>
+ <span style={{ fontSize: 10, color: 'var(--text)', maxWidth: 170, textAlign: 'right', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{v}</span>
</div>
))}
@@ -350,15 +350,15 @@ function NodeDetail({ node, onWhitelist }) {
{processes.length > 0 && (
<>
- <div style={{ fontSize: 9, color: '#475569', textTransform: 'uppercase', letterSpacing: 0.5, marginTop: 8, marginBottom: 4 }}>
+ <div style={{ fontSize: 9, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: 0.5, marginTop: 8, marginBottom: 4 }}>
{t('processes')}
</div>
{processes.map(([name, stats]) => (
<div key={name} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 3, alignItems: 'center' }}>
- <span style={{ fontSize: 10, color: '#94a3b8', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: 150 }}>
+ <span style={{ fontSize: 10, color: 'var(--text-dim)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', maxWidth: 150 }}>
{name}
</span>
- <span style={{ fontSize: 9, color: '#475569', flexShrink: 0 }}>{fmt(stats.bytes)}</span>
+ <span style={{ fontSize: 9, color: 'var(--text-faint)', flexShrink: 0 }}>{fmt(stats.bytes)}</span>
</div>
))}
</>
@@ -371,7 +371,7 @@ function NodeDetail({ node, onWhitelist }) {
marginTop: 10, width: '100%', display: 'flex', alignItems: 'center',
justifyContent: 'center', gap: 6,
background: 'none', border: '1px solid #22c55e', borderRadius: 6,
- padding: '5px 0', color: '#86efac', fontSize: 10, cursor: 'pointer',
+ padding: '5px 0', color: 'var(--green-text)', fontSize: 10, cursor: 'pointer',
}}>
<ShieldOff size={11} />
{t('whitelist_action')}
@@ -394,10 +394,10 @@ function PacketRow({ packet }) {
{packet.process}
</span>
)}
- <span style={{ fontSize: 9, color: '#94a3b8', flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
+ <span style={{ fontSize: 9, color: 'var(--text-dim)', flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{packet.dst} · {packet.protocol}
</span>
- <span style={{ fontSize: 9, color: '#475569', flexShrink: 0 }}>{packet.size}B</span>
+ <span style={{ fontSize: 9, color: 'var(--text-faint)', flexShrink: 0 }}>{packet.size}B</span>
</div>
)
}
diff --git a/frontend/src/components/Timeline.jsx b/frontend/src/components/Timeline.jsx
index b8b6282..6de88e2 100644
--- a/frontend/src/components/Timeline.jsx
+++ b/frontend/src/components/Timeline.jsx
@@ -92,7 +92,7 @@ export default function Timeline() {
// EN: Horizontal grid lines. / FR: Lignes de grille horizontales.
g.append('g').attr('class', 'grid')
.call(d3.axisLeft(y).ticks(3).tickSize(-innerW).tickFormat(''))
- .selectAll('line').attr('stroke', '#1c1c1c').attr('stroke-dasharray', '3,3')
+ .selectAll('line').style('stroke', 'var(--surface-2)').attr('stroke-dasharray', '3,3')
g.select('.grid .domain').remove()
// EN: Bars — amber when the minute produced alerts, blue otherwise.
@@ -105,8 +105,8 @@ export default function Timeline() {
.attr('y', d => y(d.packets))
.attr('width', x.bandwidth())
.attr('height', d => innerH - y(d.packets))
- .attr('fill', d => d.alerts > 0 ? '#f59e0b' : '#3b82f6')
- .attr('fill-opacity', d => d.alerts > 0 ? 0.85 : 0.65)
+ .style('fill', d => d.alerts > 0 ? '#f59e0b' : '#3b82f6')
+ .style('fill-opacity', d => d.alerts > 0 ? 0.85 : 0.65)
.attr('rx', 2)
.on('mouseover', (e, d) => setTooltip({ x: e.clientX, y: e.clientY, d }))
.on('mousemove', (e) => setTooltip(tt => tt ? { ...tt, x: e.clientX, y: e.clientY } : null))
@@ -121,7 +121,7 @@ export default function Timeline() {
.attr('cx', d => x(d.minute) + x.bandwidth() / 2)
.attr('cy', d => y(d.packets) - 5)
.attr('r', 3)
- .attr('fill', '#ef4444')
+ .style('fill', '#ef4444')
.attr('pointer-events', 'none')
// EN: Thin out x labels — ~8 ticks max.
@@ -135,13 +135,13 @@ export default function Timeline() {
.attr('transform', `translate(0,${innerH})`)
.call(xAxis)
.selectAll('text')
- .attr('fill', '#475569').attr('font-size', 9)
- g.selectAll('.domain, .tick line').attr('stroke', '#2a2a2a')
+ .style('fill', 'var(--text-faint)').attr('font-size', 9)
+ g.selectAll('.domain, .tick line').style('stroke', 'var(--border)')
g.append('g')
.call(d3.axisLeft(y).ticks(3).tickFormat(d => d > 999 ? `${(d / 1000).toFixed(0)}k` : d))
- .selectAll('text').attr('fill', '#475569').attr('font-size', 9)
- g.select('.domain').attr('stroke', '#2a2a2a')
+ .selectAll('text').style('fill', 'var(--text-faint)').attr('font-size', 9)
+ g.select('.domain').style('stroke', 'var(--border)')
}
const totalPkts = data.reduce((a, d) => a + d.packets, 0)
@@ -155,8 +155,8 @@ export default function Timeline() {
rayon 12 px assorti aux cartes de la sidebar. */
<div style={{
height: expanded ? EXPANDED_H : COLLAPSED_H,
- background: '#0f0f0f',
- border: '1px solid #1c1c1c',
+ background: 'var(--surface)',
+ border: '1px solid var(--surface-2)',
borderRadius: 12,
margin: '0 8px 8px',
transition: 'height 0.2s ease',
@@ -171,10 +171,10 @@ export default function Timeline() {
style={{
height: COLLAPSED_H, display: 'flex', alignItems: 'center',
padding: '0 16px', gap: 20, cursor: 'pointer',
- borderBottom: expanded ? '1px solid #1c1c1c' : 'none',
+ borderBottom: expanded ? '1px solid var(--surface-2)' : 'none',
}}
>
- <span style={{ fontSize: 10, fontWeight: 700, color: '#64748b', textTransform: 'uppercase', letterSpacing: 1 }}>
+ <span style={{ fontSize: 10, fontWeight: 700, color: 'var(--text-muted)', textTransform: 'uppercase', letterSpacing: 1 }}>
Timeline
</span>
@@ -191,9 +191,9 @@ export default function Timeline() {
key={m}
onClick={e => { e.stopPropagation(); setRange(m) }}
style={{
- background: range === m ? '#1c1c1c' : 'transparent',
- border: '1px solid #1c1c1c', borderRadius: 4,
- color: range === m ? '#93c5fd' : '#475569',
+ background: range === m ? 'var(--surface-2)' : 'transparent',
+ border: '1px solid var(--surface-2)', borderRadius: 4,
+ color: range === m ? 'var(--blue-text)' : 'var(--text-faint)',
fontSize: 9, padding: '2px 7px', cursor: 'pointer',
}}
>
@@ -220,13 +220,13 @@ export default function Timeline() {
{tooltip && (
<div style={{
position: 'fixed', left: tooltip.x + 12, top: tooltip.y - 60,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 6, padding: '6px 10px', fontSize: 10,
- color: '#e2e8f0', pointerEvents: 'none', zIndex: 500,
+ color: 'var(--text)', pointerEvents: 'none', zIndex: 500,
}}>
<div style={{ fontWeight: 700, marginBottom: 3 }}>{fmtMinute(tooltip.d.minute)}</div>
<div>{t('timeline_packets', tooltip.d.packets)}</div>
- <div style={{ color: '#64748b' }}>{fmt(tooltip.d.bytes)}</div>
+ <div style={{ color: 'var(--text-muted)' }}>{fmt(tooltip.d.bytes)}</div>
{tooltip.d.alerts > 0 && (
<div style={{ color: '#f59e0b', marginTop: 2 }}>! {t('timeline_alerts', tooltip.d.alerts)}</div>
)}
diff --git a/frontend/src/graph/ForceGraph.jsx b/frontend/src/graph/ForceGraph.jsx
index 14b8018..0326f24 100644
--- a/frontend/src/graph/ForceGraph.jsx
+++ b/frontend/src/graph/ForceGraph.jsx
@@ -122,7 +122,7 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
.attr('refX', 22).attr('refY', 0)
.attr('markerWidth', 6).attr('markerHeight', 6)
.attr('orient', 'auto')
- .append('path').attr('fill', '#475569').attr('d', 'M0,-5L10,0L0,5')
+ .append('path').style('fill', 'var(--text-faint)').attr('d', 'M0,-5L10,0L0,5')
const g = svg.append('g')
gRef.current = g
@@ -283,16 +283,16 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
perimG.current.selectAll('*').remove()
perimG.current.append('circle')
.attr('cx', cx).attr('cy', cy).attr('r', pr)
- .attr('fill', '#f97316').attr('fill-opacity', 0.03)
- .attr('stroke', '#f97316').attr('stroke-opacity', 0.4)
- .attr('stroke-width', 1.2).attr('stroke-dasharray', '5,7')
+ .style('fill', '#f97316').style('fill-opacity', 0.03)
+ .style('stroke', '#f97316').style('stroke-opacity', 0.4)
+ .style('stroke-width', 1.2).attr('stroke-dasharray', '5,7')
.attr('pointer-events', 'none')
perimG.current.append('text')
.attr('x', cx).attr('y', cy - pr - 10)
.attr('text-anchor', 'middle')
.attr('font-size', 10).attr('font-weight', 700)
.attr('letter-spacing', 3)
- .attr('fill', '#f97316').attr('fill-opacity', 0.75)
+ .style('fill', '#f97316').style('fill-opacity', 0.75)
.attr('pointer-events', 'none')
.text(tRef.current('perim_lan'))
}
@@ -310,9 +310,9 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
const link = linkG.current.selectAll('line')
.data(allEdges, d => d.id)
.join('line')
- .attr('stroke', d => d.color || '#475569')
- .attr('stroke-opacity', d => d.dashed ? 0.35 : 0.55)
- .attr('stroke-width', edgeWidth)
+ .style('stroke', d => d.color || 'var(--text-faint)')
+ .style('stroke-opacity', d => d.dashed ? 0.35 : 0.55)
+ .style('stroke-width', edgeWidth)
.attr('stroke-dasharray', d => d.dashed ? '5,4' : null)
.attr('marker-end', d => d.dashed ? null : 'url(#arrow)')
@@ -321,7 +321,7 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
const linkLabel = labelG.current.selectAll('text')
.data(allEdges.filter(e => !e.dashed), d => d.id)
.join('text')
- .attr('fill', '#475569')
+ .style('fill', 'var(--text-faint)')
.attr('font-size', 9)
.attr('text-anchor', 'middle')
.text(d => d.label)
@@ -352,15 +352,15 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
en.filter(d => d.id === 'local' || d.category === 'lan_device')
.append('circle')
.attr('r', d => radius(d) + 6)
- .attr('fill', d => d.color)
- .attr('fill-opacity', 0.15)
+ .style('fill', d => d.color)
+ .style('fill-opacity', 0.15)
en.append('circle')
.attr('r', radius)
- .attr('fill', d => d.color || '#475569')
- .attr('fill-opacity', d => d.online === false ? 0.35 : 0.85)
- .attr('stroke', d => d.online === false ? '#475569' : '#0f0f0f')
- .attr('stroke-width', d => d.category === 'lan_device' ? 2.5 : 1.5)
+ .style('fill', d => d.color || 'var(--text-faint)')
+ .style('fill-opacity', d => d.online === false ? 0.35 : 0.85)
+ .style('stroke', d => d.online === false ? 'var(--text-faint)' : 'var(--surface)')
+ .style('stroke-width', d => d.category === 'lan_device' ? 2.5 : 1.5)
.attr('stroke-dasharray', d => d.online === false ? '4,3' : null)
// EN: White Lucide icon inside the circle, via data-URI SVG.
@@ -378,7 +378,7 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
en.append('text')
.attr('y', d => radius(d) + 11)
.attr('text-anchor', 'middle')
- .attr('fill', d => d.category === 'lan_device' ? '#e2e8f0' : '#94a3b8')
+ .style('fill', d => d.category === 'lan_device' ? 'var(--text)' : 'var(--text-dim)')
.attr('font-size', d => d.category === 'lan_device' ? 10 : 9)
.attr('font-weight', d => d.category === 'lan_device' ? '600' : '400')
.text(d => nodeLabel(d, displayNameRef.current))
@@ -463,7 +463,7 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
[...Object.values(nodes), ...Object.values(lanDevices)].map(n => [n.id, n])
)
- link.attr('stroke-width', d => edgeWidth(edgeById.get(d.id) || d))
+ link.style('stroke-width', d => edgeWidth(edgeById.get(d.id) || d))
node.select('title').text(d => nodeTitle(nodeById.get(d.id) || d, displayNameRef.current))
node.select('text').text(d => nodeLabel(nodeById.get(d.id) || d, displayNameRef.current))
@@ -545,7 +545,7 @@ export default function ForceGraph({ nodes, edges, lanDevices, alertedNodes = ne
nodeSel.current.attr('opacity', d => matches(d) ? 1 : 0.1)
- linkSel.current.attr('stroke-opacity', d => {
+ linkSel.current.style('stroke-opacity', d => {
const src = typeof d.source === 'object' ? d.source : { id: d.source, category: '' }
const tgt = typeof d.target === 'object' ? d.target : { id: d.target, category: '' }
return (matches(src) || matches(tgt)) ? (d.dashed ? 0.35 : 0.55) : 0.04
@@ -598,10 +598,10 @@ function paintAlertRings(nodeSel, alertedNodes) {
// EN: Label tint follows the verdict.
// FR: La teinte de l'étiquette suit le verdict.
- g.select('text').attr('fill',
- sev === 'critical' ? '#f87171'
- : sev === 'warning' ? '#fbbf24'
- : (d.category === 'lan_device' ? '#e2e8f0' : '#94a3b8'))
+ g.select('text').style('fill',
+ sev === 'critical' ? 'var(--red-text)'
+ : sev === 'warning' ? 'var(--warn-text)'
+ : (d.category === 'lan_device' ? 'var(--text)' : 'var(--text-dim)'))
if (!want) return
@@ -610,17 +610,17 @@ function paintAlertRings(nodeSel, alertedNodes) {
.attr('class', 'status-ring')
.attr('data-kind', want)
.attr('r', baseR + 9)
- .attr('fill', 'none')
+ .style('fill', 'none')
if (want === 'safe') {
- c.attr('stroke', '#22c55e').attr('stroke-opacity', 0.5)
- .attr('stroke-width', 1.2)
+ c.style('stroke', '#22c55e').style('stroke-opacity', 0.5)
+ .style('stroke-width', 1.2)
return
}
if (sev === 'critical') {
// EN: Thick steady ring …
// FR: Anneau fixe épais …
- c.attr('stroke', '#ef4444').attr('stroke-opacity', 0.9)
- .attr('stroke-width', 2.5)
+ c.style('stroke', '#ef4444').style('stroke-opacity', 0.9)
+ .style('stroke-width', 2.5)
// EN: … + radar ping expanding outward and fading — reads as an
// alarm, not a status.
// FR: … + ping radar qui s'étend et s'estompe — se lit comme une
@@ -628,9 +628,9 @@ function paintAlertRings(nodeSel, alertedNodes) {
const ping = g.insert('circle', ':first-child')
.attr('class', 'status-ping')
.attr('r', baseR + 6)
- .attr('fill', 'none')
- .attr('stroke', '#ef4444')
- .attr('stroke-width', 2)
+ .style('fill', 'none')
+ .style('stroke', '#ef4444')
+ .style('stroke-width', 2)
ping.append('animate')
.attr('attributeName', 'r')
.attr('values', `${baseR + 6};${baseR + 28}`)
@@ -644,18 +644,18 @@ function paintAlertRings(nodeSel, alertedNodes) {
g.append('circle')
.attr('class', 'alert-badge')
.attr('cx', baseR - 1).attr('cy', -(baseR - 1))
- .attr('r', 5.5).attr('fill', '#ef4444')
+ .attr('r', 5.5).style('fill', '#ef4444')
g.append('text')
.attr('class', 'alert-badge-txt')
.attr('x', baseR - 1).attr('y', -(baseR - 1) + 3)
.attr('text-anchor', 'middle')
- .attr('fill', '#fff').attr('font-size', 8)
+ .style('fill', '#fff').attr('font-size', 8)
.attr('font-weight', 'bold').text('!')
return
}
- c.attr('stroke', RING_COLORS[sev] || '#f59e0b')
- .attr('stroke-opacity', 0.7)
- .attr('stroke-width', 1.5)
+ c.style('stroke', RING_COLORS[sev] || '#f59e0b')
+ .style('stroke-opacity', 0.7)
+ .style('stroke-width', 1.5)
.append('animate')
.attr('attributeName', 'stroke-opacity')
.attr('values', '0.7;0.1;0.7')
diff --git a/frontend/src/map/MapView.jsx b/frontend/src/map/MapView.jsx
index 796b43d..b470543 100644
--- a/frontend/src/map/MapView.jsx
+++ b/frontend/src/map/MapView.jsx
@@ -169,25 +169,25 @@ export default function MapView({ nodes, onNodeClick }) {
const g = gRef.current
if (!g) return
- g.select('.graticule').attr('stroke-width', 0.3 / k)
- g.select('.borders').attr('stroke-width', 0.3 / k)
- g.selectAll('.countries path').attr('stroke-width', 0.5 / k)
+ g.select('.graticule').style('stroke-width', 0.3 / k)
+ g.select('.borders').style('stroke-width', 0.3 / k)
+ g.selectAll('.countries path').style('stroke-width', 0.5 / k)
g.selectAll('path.arc-flow').each(function (d) {
const base = 0.8 + Math.log1p((d?.bytes || 0) / 512)
- d3.select(this).attr('stroke-width', Math.min(base, 3.5) / k)
+ d3.select(this).style('stroke-width', Math.min(base, 3.5) / k)
})
g.selectAll('g.dest').each(function (d) {
const r = Math.min(3 + Math.log1p((d?.packets || 0) * 0.4), 9)
const vr = r / k
- d3.select(this).select('.dot').attr('r', vr).attr('stroke-width', 1 / k)
+ d3.select(this).select('.dot').attr('r', vr).style('stroke-width', 1 / k)
d3.select(this).select('.dot-label')
.attr('font-size', Math.max(9 / k, 5))
.attr('y', vr + 10 / k)
})
- g.select('.user-dot').attr('r', 7 / k).attr('stroke-width', 1.5 / k)
+ g.select('.user-dot').attr('r', 7 / k).style('stroke-width', 1.5 / k)
g.select('.user-label').attr('font-size', 11 / k).attr('x', function () {
return +d3.select(this).attr('data-ux') + 10 / k
})
@@ -239,16 +239,16 @@ export default function MapView({ nodes, onNodeClick }) {
g.append('rect')
.attr('width', W * 4).attr('height', H * 4)
.attr('x', -W).attr('y', -H)
- .attr('fill', '#000000')
- .attr('fill-opacity', 0.55)
+ .style('fill', 'var(--bg)')
+ .style('fill-opacity', 0.55)
g.append('path')
.attr('class', 'graticule')
.datum(d3.geoGraticule()())
.attr('d', geoPath)
- .attr('fill', 'none')
- .attr('stroke', '#1c1c1c')
- .attr('stroke-width', 0.3)
+ .style('fill', 'none')
+ .style('stroke', 'var(--surface-2)')
+ .style('stroke-width', 0.3)
const countries = topojson.feature(topo, topo.objects.countries)
g.append('g').attr('class', 'countries')
@@ -256,17 +256,17 @@ export default function MapView({ nodes, onNodeClick }) {
.data(countries.features)
.join('path')
.attr('d', geoPath)
- .attr('fill', '#0f0f0f')
- .attr('stroke', '#2d4a6e')
- .attr('stroke-width', 0.5)
+ .style('fill', 'var(--surface)')
+ .style('stroke', 'var(--map-border)')
+ .style('stroke-width', 0.5)
g.append('path')
.attr('class', 'borders')
.datum(topojson.mesh(topo, topo.objects.countries, (a, b) => a !== b))
.attr('d', geoPath)
- .attr('fill', 'none')
- .attr('stroke', '#2a2a2a')
- .attr('stroke-width', 0.3)
+ .style('fill', 'none')
+ .style('stroke', 'var(--border)')
+ .style('stroke-width', 0.3)
// EN: Layer order matters: arcs below dots.
// FR: L'ordre des couches compte : arcs sous les points.
@@ -284,8 +284,8 @@ export default function MapView({ nodes, onNodeClick }) {
const base = 10 + i * 8
userG.append('circle')
.attr('cx', ux).attr('cy', uy).attr('r', base)
- .attr('fill', 'none').attr('stroke', '#3b82f6')
- .attr('stroke-opacity', 0.3 - i * 0.1)
+ .style('fill', 'none').style('stroke', '#3b82f6')
+ .style('stroke-opacity', 0.3 - i * 0.1)
.append('animate').attr('attributeName', 'r')
.attr('values', `${base};${base + 18};${base}`)
.attr('dur', `${2.5 + i * 0.8}s`).attr('repeatCount', 'indefinite')
@@ -294,14 +294,14 @@ export default function MapView({ nodes, onNodeClick }) {
userG.append('circle')
.attr('class', 'user-dot')
.attr('cx', ux).attr('cy', uy).attr('r', 7)
- .attr('fill', '#3b82f6').attr('fill-opacity', 0.9)
- .attr('stroke', '#93c5fd').attr('stroke-width', 1.5)
+ .style('fill', '#3b82f6').style('fill-opacity', 0.9)
+ .style('stroke', 'var(--blue-text)').style('stroke-width', 1.5)
userG.append('text')
.attr('class', 'user-label')
.attr('data-ux', ux)
.attr('x', ux + 10).attr('y', uy + 4)
- .attr('fill', '#93c5fd').attr('font-size', 11).attr('font-weight', '700')
+ .style('fill', 'var(--blue-text)').attr('font-size', 11).attr('font-weight', '700')
.text(youLabel)
}
@@ -332,7 +332,7 @@ export default function MapView({ nodes, onNodeClick }) {
const arcsEnter = arcs.enter().append('path')
.attr('class', 'arc-flow')
- .attr('fill', 'none')
+ .style('fill', 'none')
.attr('pointer-events', 'none')
.style('animation-duration', d => animDur(d.id))
@@ -341,9 +341,9 @@ export default function MapView({ nodes, onNodeClick }) {
const [jx, jy] = jitter(d.id)
return geoPath({ type: 'LineString', coordinates: [pos, [d.lon + jx, d.lat + jy]] })
})
- .attr('stroke', d => d.color || '#94a3b8')
- .attr('stroke-opacity', 0.4)
- .attr('stroke-width', d => Math.min(0.8 + Math.log1p((d.bytes || 0) / 512), 3.5) / k)
+ .style('stroke', d => d.color || 'var(--text-dim)')
+ .style('stroke-opacity', 0.4)
+ .style('stroke-width', d => Math.min(0.8 + Math.log1p((d.bytes || 0) / 512), 3.5) / k)
.each(function () {
// EN: pathLength normalizes the dash cycle so CSS animation works
// on any arc length.
@@ -362,9 +362,9 @@ export default function MapView({ nodes, onNodeClick }) {
.data(geoNodes, d => d.id)
const enter = dotGroups.enter().append('g').attr('class', 'dest')
- enter.append('circle').attr('class', 'pulse').attr('fill', 'none').attr('stroke-opacity', 0)
- enter.append('circle').attr('class', 'dot').attr('stroke', '#0a1628')
- enter.append('text').attr('class', 'dot-label').attr('fill', '#cbd5e1').attr('text-anchor', 'middle').attr('pointer-events', 'none')
+ enter.append('circle').attr('class', 'pulse').style('fill', 'none').style('stroke-opacity', 0)
+ enter.append('circle').attr('class', 'dot').style('stroke', 'var(--dot-stroke)')
+ enter.append('text').attr('class', 'dot-label').style('fill', 'var(--text-2)').attr('text-anchor', 'middle').attr('pointer-events', 'none')
const all = enter.merge(dotGroups)
@@ -379,15 +379,15 @@ export default function MapView({ nodes, onNodeClick }) {
d3.select(this).attr('transform', `translate(${x},${y})`)
const pulse = d3.select(this).select('.pulse')
- pulse.attr('r', (r + 3) / k).attr('stroke', d.color || '#94a3b8')
+ pulse.attr('r', (r + 3) / k).style('stroke', d.color || 'var(--text-dim)')
pulse.selectAll('animate').remove()
pulse.append('animate').attr('attributeName', 'stroke-opacity')
.attr('values', '0.5;0;0.5').attr('dur', '3s').attr('repeatCount', 'indefinite')
d3.select(this).select('.dot')
.attr('r', vr)
- .attr('fill', d.color || '#94a3b8')
- .attr('stroke-width', 1 / k)
+ .style('fill', d.color || 'var(--text-dim)')
+ .style('stroke-width', 1 / k)
.attr('cursor', 'pointer')
d3.select(this).select('.dot-label')
@@ -422,8 +422,8 @@ export default function MapView({ nodes, onNodeClick }) {
FR: Badge compteur d'hôtes géolocalisés — sous la barre d'outils flottante. */}
<div style={{
position: 'absolute', top: 64, left: 16,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
- borderRadius: 8, padding: '8px 14px', fontSize: 10, color: '#64748b',
+ background: 'var(--surface)', border: '1px solid var(--border)',
+ borderRadius: 8, padding: '8px 14px', fontSize: 10, color: 'var(--text-muted)',
}}>
<span style={{ color: '#22c55e', fontWeight: 700 }}>{t('map_located', geoCount)}</span>
{noGeoCount > 0 && <span> · <span style={{ color: '#f59e0b' }}>{noGeoCount}</span> {t('map_no_geo')}</span>}
@@ -433,24 +433,24 @@ export default function MapView({ nodes, onNodeClick }) {
{tooltip && (
<div style={{
position: 'fixed', left: tooltip.x + 14, top: tooltip.y - 10, zIndex: 100,
- background: '#0f0f0f', border: '1px solid #2a2a2a',
+ background: 'var(--surface)', border: '1px solid var(--border)',
borderRadius: 8, padding: '8px 12px', pointerEvents: 'none',
boxShadow: '0 4px 20px rgba(0,0,0,0.5)',
}}>
- <div style={{ fontWeight: 700, fontSize: 12, color: '#f1f5f9', marginBottom: 3 }}>
+ <div style={{ fontWeight: 700, fontSize: 12, color: 'var(--text)', marginBottom: 3 }}>
{tooltip.node.label || (tooltip.node.label_key ? t(tooltip.node.label_key) : null) || tooltip.node.ip}
</div>
{tooltip.node.country && (
- <div style={{ fontSize: 10, color: '#94a3b8' }}>
+ <div style={{ fontSize: 10, color: 'var(--text-dim)' }}>
{[tooltip.node.city, tooltip.node.country].filter(Boolean).join(', ')}
</div>
)}
{tooltip.node.org && (
- <div style={{ fontSize: 10, color: '#64748b' }}>{tooltip.node.org}</div>
+ <div style={{ fontSize: 10, color: 'var(--text-muted)' }}>{tooltip.node.org}</div>
)}
<div style={{ marginTop: 5, fontSize: 10, display: 'flex', gap: 10 }}>
<span style={{ color: tooltip.node.color }}>{tooltip.node.category}</span>
- <span style={{ color: '#475569' }}>{tooltip.node.packets} pkt</span>
+ <span style={{ color: 'var(--text-faint)' }}>{tooltip.node.packets} pkt</span>
</div>
</div>
)}
diff --git a/frontend/src/theme.js b/frontend/src/theme.js
new file mode 100644
index 0000000..972f007
--- /dev/null
+++ b/frontend/src/theme.js
@@ -0,0 +1,38 @@
+/**
+ * EN: Theme awareness for JS-driven visuals. Chrome styles paint through
+ * CSS vars (see index.html) and update for free; components that feed
+ * colours to non-CSS renderers (WebGL aurora, canvas probes) use
+ * `useTheme()` to re-render when the toggle flips data-theme.
+ * FR: Conscience du thème pour les visuels pilotés en JS. Le chrome peint
+ * via les vars CSS (index.html) et se met à jour tout seul ; les
+ * composants qui alimentent des renderers non-CSS (aurore WebGL,
+ * sondes canvas) utilisent `useTheme()` pour re-render quand le toggle
+ * bascule data-theme.
+ */
+import { useState, useEffect } from 'react'
+
+/** EN: Current theme ('dark' | 'light'), live.
+ * FR: Thème courant ('dark' | 'light'), en direct. */
+export function currentTheme() {
+ return document.documentElement.dataset.theme === 'light' ? 'light' : 'dark'
+}
+
+/** EN: React hook — re-renders the component on every theme switch.
+ * FR: Hook React — re-render le composant à chaque bascule de thème. */
+export function useTheme() {
+ const [theme, setTheme] = useState(currentTheme)
+ useEffect(() => {
+ const onChange = () => setTheme(currentTheme())
+ window.addEventListener('snitch-theme', onChange)
+ return () => window.removeEventListener('snitch-theme', onChange)
+ }, [])
+ return theme
+}
+
+/** EN: Resolve a design token to a concrete colour for canvas/GL code that
+ * cannot consume var(--x). / FR: Résout un token en couleur concrète
+ * pour le code canvas/GL qui ne sait pas lire var(--x). */
+export function token(name, fallback = '#000000') {
+ const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
+ return v || fallback
+}