diff --git a/src/myfasthtml/assets/core/hierarchical_canvas_graph.css b/src/myfasthtml/assets/core/hierarchical_canvas_graph.css
index 8d717d2..da462d2 100644
--- a/src/myfasthtml/assets/core/hierarchical_canvas_graph.css
+++ b/src/myfasthtml/assets/core/hierarchical_canvas_graph.css
@@ -4,6 +4,35 @@
* Styles for the canvas-based hierarchical graph visualization control.
*/
+/* *********************************************** */
+/* ********** Color Variables (DaisyUI) ********** */
+/* *********************************************** */
+
+/* Instance kind colors - hardcoded to preserve visual identity */
+:root {
+ --hcg-color-root: #2563eb;
+ --hcg-color-single: #7c3aed;
+ --hcg-color-multiple: #047857;
+ --hcg-color-unique: #b45309;
+
+ /* UI colors */
+ --hcg-bg-main: var(--color-base-100, #0d1117);
+ --hcg-bg-button: var(--color-base-200, rgba(22, 27, 34, 0.92));
+ --hcg-border: var(--color-border, #30363d);
+ --hcg-text-muted: color-mix(in oklab, var(--color-base-content, #e6edf3) 50%, transparent);
+ --hcg-text-primary: var(--color-base-content, #e6edf3);
+
+ /* Canvas drawing colors */
+ --hcg-dot-grid: rgba(125, 133, 144, 0.12);
+ --hcg-edge: rgba(48, 54, 61, 0.9);
+ --hcg-edge-dimmed: rgba(48, 54, 61, 0.25);
+ --hcg-node-bg: var(--color-base-300, #1c2128);
+ --hcg-node-bg-selected: color-mix(in oklab, var(--color-base-300, #1c2128) 70%, #f0883e 30%);
+ --hcg-node-border-selected: #f0883e;
+ --hcg-node-border-match: #e3b341;
+ --hcg-node-glow: #f0883e;
+}
+
/* Main control wrapper */
.mf-hierarchical-canvas-graph {
display: flex;
@@ -19,7 +48,7 @@
flex: 1;
position: relative;
overflow: hidden;
- background: #0d1117;
+ background: var(--hcg-bg-main);
width: 100%;
height: 100%;
}
@@ -47,8 +76,8 @@
position: absolute;
top: 12px;
left: 12px;
- background: rgba(22, 27, 34, 0.92);
- border: 1px solid #30363d;
+ background: var(--hcg-bg-button);
+ border: 1px solid var(--hcg-border);
border-radius: 8px;
padding: 6px;
display: flex;
@@ -65,10 +94,10 @@
right: 12px;
width: 32px;
height: 32px;
- background: rgba(22, 27, 34, 0.92);
- border: 1px solid #30363d;
+ background: var(--hcg-bg-button);
+ border: 1px solid var(--hcg-border);
border-radius: 6px;
- color: #7d8590;
+ color: var(--hcg-text-muted);
font-size: 16px;
cursor: pointer;
display: flex;
@@ -82,8 +111,8 @@
}
.mf-hcg-toggle-btn:hover {
- color: #e6edf3;
- background: #1c2128;
+ color: var(--hcg-text-primary);
+ background: color-mix(in oklab, var(--hcg-bg-main) 90%, var(--hcg-text-primary) 10%);
}
/* Optional: loading state */
@@ -93,7 +122,7 @@
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
- color: #7d8590;
+ color: var(--hcg-text-muted);
font-size: 14px;
font-family: system-ui, sans-serif;
}
diff --git a/src/myfasthtml/assets/core/hierarchical_canvas_graph.js b/src/myfasthtml/assets/core/hierarchical_canvas_graph.js
index 7ca41ff..2a4119e 100644
--- a/src/myfasthtml/assets/core/hierarchical_canvas_graph.js
+++ b/src/myfasthtml/assets/core/hierarchical_canvas_graph.js
@@ -23,8 +23,8 @@
* @param {Array