@stnd/lab 0.2.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,13 +34,14 @@
34
34
  "--ratio-wholestep": { min: 1, max: 3, step: 0.01, unit: "" },
35
35
  "--ratio-halfstep": { min: 1, max: 2, step: 0.01, unit: "" },
36
36
  "--font-weight": { min: 100, max: 900, step: 100, unit: "" },
37
- "--bold-weight": { min: 100, max: 900, step: 100, unit: "" },
37
+ "--font-weight-bold": { min: 100, max: 900, step: 100, unit: "" },
38
38
  "--radius": { min: 0, max: 2, step: 0.05, unit: "rem" },
39
39
  "--line-width": { min: 0, max: 10, step: 0.5, unit: "px" },
40
40
  "--base": { min: 0.5, max: 3, step: 0.05, unit: "rem" },
41
41
  "--base-gap": { min: 0, max: 3, step: 0.05, unit: "rem" },
42
42
  "--base-block-gap": { min: 0, max: 3, step: 0.05, unit: "rem" },
43
43
  "--body-padding": { min: 0, max: 5, step: 0.25, unit: "rem" },
44
+ "--gap-body": { min: 0, max: 4, step: 0.25, unit: "rem" },
44
45
  "--gap": { min: 0, max: 3, step: 0.05, unit: "rem" },
45
46
  "--grid-gap": { min: 0, max: 3, step: 0.05, unit: "rem" },
46
47
  };
@@ -55,7 +56,7 @@
55
56
  "--optical-ratio",
56
57
  "--line-height",
57
58
  "--font-weight",
58
- "--bold-weight",
59
+ "--font-weight-bold",
59
60
  "--font-letter-spacing",
60
61
  "--font-header-letter-spacing",
61
62
  "--font-header-weight",
@@ -63,9 +64,9 @@
63
64
  layout: [
64
65
  "--line-width",
65
66
  "--line-width-xs",
66
- "--line-width-s",
67
- "--line-width-m",
68
- "--line-width-l",
67
+ "--line-width-sm",
68
+ "--line-width-md",
69
+ "--line-width-lg",
69
70
  "--line-width-xl",
70
71
  "--base",
71
72
  "--base-gap",
@@ -81,7 +82,7 @@
81
82
  "--ratio-wholestep",
82
83
  "--ratio-halfstep",
83
84
  "--radius",
84
- "--blur",
85
+ "--filter-blur",
85
86
  "--transition",
86
87
  "--line-width",
87
88
  "--shadow",
@@ -91,21 +92,20 @@
91
92
 
92
93
  // NEW: CSS Variable configuration for StandardLab styling
93
94
  this.cssVars = {
94
- "--standard-lab-bg":
95
+ "--stnd-lab-bg":
95
96
  "color-mix( in srgb, var(--color-dark-background) 90%, var(--color-dark-foreground))",
96
- "--standard-lab-text":
97
+ "--stnd-lab-text":
97
98
  "color-mix( in srgb, var(--color-dark-background) 10%, var(--color-dark-foreground))",
98
- "--standard-lab-text-size": "12px",
99
- "--standard-lab-opacity": "1",
100
- "--standard-lab-accent": "var(--color-accent)",
101
- "--standard-lab-border": "var(--border)",
102
- "--standard-lab-shadow": "var(--shadow)",
103
- "--standard-lab-blur": "var(--blur)",
104
- "--standard-lab-font-family": "var(--font-monospace)",
99
+ "--stnd-lab-text-size": "12px",
100
+ "--stnd-lab-opacity": "1",
101
+ "--stnd-lab-accent": "var(--color-accent)",
102
+ "--stnd-lab-border": "var(--border)",
103
+ "--stnd-lab-shadow": "var(--shadow)",
104
+ "--stnd-lab-blur": "var(--filter-blur)",
105
+ "--stnd-lab-font-family": "var(--font-monospace)",
105
106
  };
106
107
 
107
108
  this.defaults = {};
108
- this.log = (window.standard && window.standard.log) || console;
109
109
  this.initCSSVars();
110
110
  this.init();
111
111
  }
@@ -119,14 +119,14 @@
119
119
 
120
120
  /**
121
121
  * Set a custom CSS variable for StandardLab styling
122
- * @param {string} varName - Variable name (e.g., "--standard-lab-bg")
122
+ * @param {string} varName - Variable name (e.g., "--stnd-lab-bg")
123
123
  * @param {string} value - CSS value
124
124
  *
125
125
  * @example
126
- * window.StandardLab.setCSSVar("--standard-lab-bg", "#1a1a1a");
127
- * window.StandardLab.setCSSVar("--standard-lab-text", "#fff");
128
- * window.StandardLab.setCSSVar("--standard-lab-text-size", "14px");
129
- * window.StandardLab.setCSSVar("--standard-lab-opacity", "0.95");
126
+ * window.StandardLab.setCSSVar("--stnd-lab-bg", "#1a1a1a");
127
+ * window.StandardLab.setCSSVar("--stnd-lab-text", "#fff");
128
+ * window.StandardLab.setCSSVar("--stnd-lab-text-size", "14px");
129
+ * window.StandardLab.setCSSVar("--stnd-lab-opacity", "0.95");
130
130
  */
131
131
  setCSSVar(varName, value) {
132
132
  this.cssVars[varName] = value;
@@ -159,7 +159,7 @@
159
159
  // Check if debug mode is already active OR if blueprint theme is active
160
160
  const currentTheme = document.documentElement.getAttribute("data-theme");
161
161
  const isDebugActive =
162
- document.documentElement.classList.contains("standard-debug");
162
+ document.documentElement.classList.contains("stnd-debug");
163
163
  const isBlueprintActive = currentTheme === "blueprint";
164
164
 
165
165
  if (isDebugActive || isBlueprintActive) {
@@ -181,7 +181,7 @@
181
181
 
182
182
  restoreTheme() {
183
183
  // Use sessionStorage instead of localStorage for tab-specific persistence
184
- const savedTheme = sessionStorage.getItem("standard-theme");
184
+ const savedTheme = sessionStorage.getItem("stnd-theme");
185
185
 
186
186
  if (savedTheme) {
187
187
  document.documentElement.setAttribute("data-theme", savedTheme);
@@ -190,23 +190,23 @@
190
190
 
191
191
  // NEW: Restore debug mode from sessionStorage
192
192
  restoreDebugMode() {
193
- const savedDebugMode = sessionStorage.getItem("standard-debug-mode");
193
+ const savedDebugMode = sessionStorage.getItem("stnd-debug-mode");
194
194
 
195
195
  if (savedDebugMode === "true") {
196
- document.documentElement.classList.add("standard-debug");
196
+ document.documentElement.classList.add("stnd-debug");
197
197
  } else if (savedDebugMode === "false") {
198
- document.documentElement.classList.remove("standard-debug");
198
+ document.documentElement.classList.remove("stnd-debug");
199
199
  }
200
200
  }
201
201
 
202
202
  // NEW: Save debug mode to sessionStorage
203
203
  saveDebugMode(isEnabled) {
204
- sessionStorage.setItem("standard-debug-mode", isEnabled.toString());
204
+ sessionStorage.setItem("stnd-debug-mode", isEnabled.toString());
205
205
  }
206
206
 
207
207
  // NEW: Restore panel state from sessionStorage
208
208
  restorePanelState() {
209
- const savedPanelState = sessionStorage.getItem("standard-panel-state");
209
+ const savedPanelState = sessionStorage.getItem("stnd-panel-state");
210
210
 
211
211
  if (savedPanelState === "quick") {
212
212
  this.openQuick();
@@ -218,9 +218,28 @@
218
218
  // NEW: Save panel state to sessionStorage
219
219
  savePanelState(state) {
220
220
  if (state === "dormant") {
221
- sessionStorage.removeItem("standard-panel-state");
221
+ sessionStorage.removeItem("stnd-panel-state");
222
222
  } else {
223
- sessionStorage.setItem("standard-panel-state", state);
223
+ sessionStorage.setItem("stnd-panel-state", state);
224
+ }
225
+ }
226
+
227
+ // Emit a window event when the panel state changes so external clients
228
+ // (for example the dev toolbar) can stay in sync with the Lab visibility.
229
+ dispatchStateEvent() {
230
+ try {
231
+ if (
232
+ typeof window !== "undefined" &&
233
+ typeof window.dispatchEvent === "function"
234
+ ) {
235
+ window.dispatchEvent(
236
+ new CustomEvent("standardlab:state", {
237
+ detail: { state: this.state },
238
+ }),
239
+ );
240
+ }
241
+ } catch (e) {
242
+ console.warn("[StandardLab] dispatchStateEvent failed", e);
224
243
  }
225
244
  }
226
245
 
@@ -274,8 +293,7 @@
274
293
  `--color-${scheme}-green`,
275
294
  `--color-${scheme}-cyan`,
276
295
  `--color-${scheme}-blue`,
277
- `--color-${scheme}-purple`,
278
- `--color-${scheme}-pink`,
296
+ `--color-${scheme}-magenta`,
279
297
  ];
280
298
  }
281
299
 
@@ -385,12 +403,14 @@
385
403
  this.state = "quick";
386
404
  this.savePanelState("quick");
387
405
  this.createQuickPanel();
406
+ this.dispatchStateEvent();
388
407
  }
389
408
 
390
409
  openFull() {
391
410
  this.state = "full";
392
411
  this.savePanelState("full");
393
412
  this.createFullPanel();
413
+ this.dispatchStateEvent();
394
414
  }
395
415
 
396
416
  close() {
@@ -406,6 +426,7 @@
406
426
  }
407
427
  this.state = "dormant";
408
428
  this.savePanelState("dormant");
429
+ this.dispatchStateEvent();
409
430
  }
410
431
 
411
432
  /**
@@ -413,16 +434,14 @@
413
434
  * Ideal for calling after HTMX swaps change the page state (e.g., theme).
414
435
  */
415
436
  refresh() {
416
- if (this.log && this.log.debug) {
417
- this.log.debug("Refreshing StandardLab");
418
- }
437
+ console.log("refresh");
419
438
  this.storeDefaults();
420
439
 
421
440
  this.badge = null;
422
441
  this.init();
423
442
 
424
443
  // Re-inject overlays if debug is active
425
- if (document.documentElement.classList.contains("standard-debug")) {
444
+ if (document.documentElement.classList.contains("stnd-debug")) {
426
445
  this.removeGridDebugOverlays();
427
446
  this.injectGridDebugOverlays();
428
447
  }
@@ -451,6 +470,16 @@
451
470
  }
452
471
  }
453
472
 
473
+ /** Read current seed / token value, resolving computed style */
474
+ _seedValue(token) {
475
+ return (
476
+ document.documentElement.style.getPropertyValue(token).trim() ||
477
+ getComputedStyle(document.documentElement)
478
+ .getPropertyValue(token)
479
+ .trim()
480
+ );
481
+ }
482
+
454
483
  createQuickPanel() {
455
484
  if (this.panel) this.panel.remove();
456
485
  this.panel = document.createElement("div");
@@ -458,17 +487,90 @@
458
487
  this.panel.className = "standard-lab-panel standard-lab-panel-quick";
459
488
  this.panel.style.bottom = `calc(${this.position.bottom}px + var(--space-2))`;
460
489
  this.panel.style.right = `${this.position.right}px`;
490
+
461
491
  const debugActive =
462
- document.documentElement.classList.contains("standard-debug");
492
+ document.documentElement.classList.contains("stnd-debug");
463
493
  const modifiedCount = this.modifiedTokens.size;
494
+
495
+ // Current seed colors
496
+ const lightBg = this._seedValue("--color-light-background");
497
+ const lightFg = this._seedValue("--color-light-foreground");
498
+ const lightBgHex = this.extractHexColor(lightBg);
499
+ const lightFgHex = this.extractHexColor(lightFg);
500
+
501
+ // Current fonts
502
+ const fontText = this._seedValue("--font-text");
503
+ const fontHeader = this._seedValue("--font-header");
504
+
505
+ // Current ratio & padding
506
+ const ratio = this._seedValue("--optical-ratio");
507
+ const ratioNum = this.extractNumericValue(ratio) || 1.414;
508
+ const gapBody = this._seedValue("--gap-body");
509
+ const gapNum = this.extractNumericValue(gapBody) || 1;
510
+
464
511
  this.panel.innerHTML = `
465
512
  <header class="standard-lab-panel-header">
466
- <div style="display:inline-block;">
467
- <h2 style="color: var(--color-dark-foreground);display:inline-block;">Inspector v${this.version}</h2>
468
- <div style="display:inline-block;" class="standard-lab-viewport-info">${window.innerWidth}px</div>
469
- </div>
470
- <button class="standard-lab-btn-icon" data-action="close" title="Close (Esc)">×</button>
471
- </header>
513
+ <div style="display:inline-flex;align-items:center;gap:6px;">
514
+ <h2 style="color:var(--color-dark-foreground);display:inline-block;">Lab v${this.version}</h2>
515
+ <div class="standard-lab-viewport-info" style="display:inline-block;">${window.innerWidth}px</div>
516
+ </div>
517
+ <button class="standard-lab-btn-icon" data-action="close" title="Close (Esc)">×</button>
518
+ </header>
519
+
520
+ <!-- Theme -->
521
+ <section class="standard-lab-section">
522
+ <label class="standard-lab-label">Theme</label>
523
+ <select class="standard-lab-select" data-action="theme">
524
+ ${this.getThemeOptions()}
525
+ </select>
526
+ </section>
527
+
528
+ <!-- Seed Colors -->
529
+ <section class="standard-lab-section">
530
+ <label class="standard-lab-label">Colors</label>
531
+ <div class="standard-lab-seed-row">
532
+ <input type="color" class="standard-lab-color-swatch" data-seed="--color-light-background" value="${lightBgHex}" title="Light background">
533
+ <input type="text" class="standard-lab-seed-input" data-seed="--color-light-background" value="${lightBg}" spellcheck="false" placeholder="background">
534
+ <span class="standard-lab-seed-tag">bg</span>
535
+ </div>
536
+ <div class="standard-lab-seed-row">
537
+ <input type="color" class="standard-lab-color-swatch" data-seed="--color-light-foreground" value="${lightFgHex}" title="Light foreground">
538
+ <input type="text" class="standard-lab-seed-input" data-seed="--color-light-foreground" value="${lightFg}" spellcheck="false" placeholder="foreground">
539
+ <span class="standard-lab-seed-tag">fg</span>
540
+ </div>
541
+ </section>
542
+
543
+ <!-- Typography -->
544
+ <section class="standard-lab-section">
545
+ <label class="standard-lab-label">Typography</label>
546
+ <div class="standard-lab-font-row">
547
+ <span class="standard-lab-font-tag">Body</span>
548
+ <input type="text" class="standard-lab-seed-input" data-seed="--font-text" value="${fontText}" spellcheck="false" placeholder="Font family">
549
+ </div>
550
+ <div class="standard-lab-font-row">
551
+ <span class="standard-lab-font-tag">Head</span>
552
+ <input type="text" class="standard-lab-seed-input" data-seed="--font-header" value="${fontHeader}" spellcheck="false" placeholder="Font family">
553
+ </div>
554
+ </section>
555
+
556
+ <!-- Scale -->
557
+ <section class="standard-lab-section">
558
+ <label class="standard-lab-label">Scale</label>
559
+ <div class="standard-lab-quick-slider">
560
+ <span class="standard-lab-font-tag">Ratio</span>
561
+ <input type="range" class="standard-lab-slider-input" data-seed="--optical-ratio"
562
+ value="${ratioNum}" min="1" max="2" step="0.01">
563
+ <span class="standard-lab-slider-readout" data-readout="--optical-ratio">${ratioNum}</span>
564
+ </div>
565
+ <div class="standard-lab-quick-slider">
566
+ <span class="standard-lab-font-tag">Gap</span>
567
+ <input type="range" class="standard-lab-slider-input" data-seed="--gap-body"
568
+ value="${gapNum}" min="0" max="4" step="0.25">
569
+ <span class="standard-lab-slider-readout" data-readout="--gap-body">${gapNum}rem</span>
570
+ </div>
571
+ </section>
572
+
573
+ <!-- Debug -->
472
574
  <section class="standard-lab-section">
473
575
  <label class="standard-lab-toggle">
474
576
  <input type="checkbox" ${debugActive ? "checked" : ""} data-toggle="debug">
@@ -476,15 +578,11 @@
476
578
  <kbd>⇧⌘D</kbd>
477
579
  </label>
478
580
  </section>
479
- <section class="standard-lab-section">
480
- <label class="standard-lab-label">Theme</label>
481
- <select class="standard-lab-select" data-action="theme">
482
- ${this.getThemeOptions()}
483
- </select>
484
- </section>
581
+
582
+ <!-- Actions -->
485
583
  <div class="standard-lab-actions">
486
584
  <button class="standard-lab-btn" data-action="edit-tokens">
487
- ${modifiedCount > 0 ? `Edit Tokens (${modifiedCount})` : "Edit Tokens"}
585
+ ${modifiedCount > 0 ? `All Tokens (${modifiedCount})` : "All Tokens"}
488
586
  </button>
489
587
  ${modifiedCount > 0 ? `<button class="standard-lab-btn standard-lab-btn-secondary" data-action="reset">Reset</button>` : ""}
490
588
  <button class="standard-lab-btn standard-lab-btn-secondary" data-action="copy">Copy CSS</button>
@@ -543,19 +641,26 @@
543
641
  }
544
642
 
545
643
  attachQuickPanelListeners() {
644
+ // Close / minimize / full-panel
546
645
  this.panel
547
646
  .querySelector('[data-action="close"]')
548
647
  ?.addEventListener("click", () => this.close());
648
+ this.panel
649
+ .querySelector('[data-action="edit-tokens"]')
650
+ ?.addEventListener("click", () => this.openFull());
651
+ this.panel
652
+ .querySelector('[data-action="reset"]')
653
+ ?.addEventListener("click", () => this.resetAll());
654
+ this.panel
655
+ .querySelector('[data-action="copy"]')
656
+ ?.addEventListener("click", () => this.copyCSS());
657
+
658
+ // Debug toggle
549
659
  this.panel
550
660
  .querySelector('[data-toggle="debug"]')
551
661
  ?.addEventListener("change", (e) => {
552
662
  const isEnabled = e.target.checked;
553
- document.documentElement.classList.toggle(
554
- "standard-debug",
555
- isEnabled,
556
- );
557
-
558
- // UPDATED: Save debug mode to sessionStorage
663
+ document.documentElement.classList.toggle("stnd-debug", isEnabled);
559
664
  this.saveDebugMode(isEnabled);
560
665
 
561
666
  const currentTheme =
@@ -571,6 +676,8 @@
571
676
  `Debug mode ${e.target.checked ? "enabled" : "disabled"}`,
572
677
  );
573
678
  });
679
+
680
+ // Theme selector
574
681
  this.panel
575
682
  .querySelector('[data-action="theme"]')
576
683
  ?.addEventListener("change", (e) => {
@@ -580,22 +687,125 @@
580
687
  } else {
581
688
  document.documentElement.removeAttribute("data-theme");
582
689
  }
583
- sessionStorage.setItem("standard-theme", theme);
584
-
585
- // Handle blueprint exception for debug mode
690
+ sessionStorage.setItem("stnd-theme", theme);
586
691
  this.handleBlueprintDebugException(theme);
587
692
 
693
+ // Re-read seed values after theme switch and update controls
694
+ this._syncQuickSeedInputs();
588
695
  window.toast?.info(`Theme: ${theme || "Default"}`);
589
696
  });
697
+
698
+ // Seed color pickers (swatch)
590
699
  this.panel
591
- .querySelector('[data-action="edit-tokens"]')
592
- ?.addEventListener("click", () => this.openFull());
700
+ .querySelectorAll(".standard-lab-color-swatch")
701
+ .forEach((swatch) => {
702
+ swatch.addEventListener("input", (e) => {
703
+ const token = e.target.dataset.seed;
704
+ const color = e.target.value;
705
+ this.updateToken(token, color);
706
+ // Sync companion text input
707
+ const textInput = this.panel.querySelector(
708
+ `.standard-lab-seed-input[data-seed="${token}"]`,
709
+ );
710
+ if (textInput) textInput.value = color;
711
+ });
712
+ });
713
+
714
+ // Seed color text inputs
593
715
  this.panel
594
- .querySelector('[data-action="reset"]')
595
- ?.addEventListener("click", () => this.resetAll());
716
+ .querySelectorAll(
717
+ '.standard-lab-seed-input[data-seed^="--color-light-"]',
718
+ )
719
+ .forEach((input) => {
720
+ input.addEventListener("input", (e) => {
721
+ const token = e.target.dataset.seed;
722
+ const value = e.target.value;
723
+ this.updateToken(token, value);
724
+ // Sync companion swatch
725
+ const swatch = this.panel.querySelector(
726
+ `.standard-lab-color-swatch[data-seed="${token}"]`,
727
+ );
728
+ if (swatch && this.isColorValue(value)) {
729
+ swatch.value = this.extractHexColor(value);
730
+ }
731
+ });
732
+ });
733
+
734
+ // Font family inputs
596
735
  this.panel
597
- .querySelector('[data-action="copy"]')
598
- ?.addEventListener("click", () => this.copyCSS());
736
+ .querySelectorAll('.standard-lab-seed-input[data-seed^="--font-"]')
737
+ .forEach((input) => {
738
+ input.addEventListener("input", (e) => {
739
+ const token = e.target.dataset.seed;
740
+ const value = e.target.value;
741
+ this.updateToken(token, value);
742
+ this.loadGoogleFont(value);
743
+ });
744
+ });
745
+
746
+ // Quick sliders (ratio, gap)
747
+ this.panel
748
+ .querySelectorAll(
749
+ ".standard-lab-quick-slider .standard-lab-slider-input",
750
+ )
751
+ .forEach((slider) => {
752
+ slider.addEventListener("input", (e) => {
753
+ const token = e.target.dataset.seed;
754
+ const num = e.target.value;
755
+ const config = this.sliderConfig[token];
756
+ const unit = config?.unit || "";
757
+ const fullValue = `${num}${unit}`;
758
+ this.updateToken(token, fullValue);
759
+ // Sync readout
760
+ const readout = this.panel.querySelector(
761
+ `.standard-lab-slider-readout[data-readout="${token}"]`,
762
+ );
763
+ if (readout) readout.textContent = fullValue || num;
764
+ });
765
+ });
766
+ }
767
+
768
+ /** Re-read seed values from computed style and sync quick-panel inputs */
769
+ _syncQuickSeedInputs() {
770
+ if (!this.panel) return;
771
+ // Small delay so theme CSS cascades before we read computed values
772
+ requestAnimationFrame(() => {
773
+ const seeds = [
774
+ "--color-light-background",
775
+ "--color-light-foreground",
776
+ "--font-text",
777
+ "--font-header",
778
+ ];
779
+ seeds.forEach((token) => {
780
+ const val = this._seedValue(token);
781
+ const textInput = this.panel?.querySelector(
782
+ `.standard-lab-seed-input[data-seed="${token}"]`,
783
+ );
784
+ if (textInput) textInput.value = val;
785
+ const swatch = this.panel?.querySelector(
786
+ `.standard-lab-color-swatch[data-seed="${token}"]`,
787
+ );
788
+ if (swatch && this.isColorValue(val)) {
789
+ swatch.value = this.extractHexColor(val);
790
+ }
791
+ });
792
+ // Sliders
793
+ ["--optical-ratio", "--gap-body"].forEach((token) => {
794
+ const val = this._seedValue(token);
795
+ const num = this.extractNumericValue(val);
796
+ const slider = this.panel?.querySelector(
797
+ `.standard-lab-slider-input[data-seed="${token}"]`,
798
+ );
799
+ if (slider) slider.value = num;
800
+ const readout = this.panel?.querySelector(
801
+ `.standard-lab-slider-readout[data-readout="${token}"]`,
802
+ );
803
+ if (readout) {
804
+ const config = this.sliderConfig[token];
805
+ readout.textContent = `${num}${config?.unit || ""}`;
806
+ }
807
+ });
808
+ });
599
809
  }
600
810
  /**
601
811
  * Handle the blueprint theme exception for debug grid overlay
@@ -604,7 +814,7 @@
604
814
  handleBlueprintDebugException(theme) {
605
815
  const isBlueprint = theme === "blueprint";
606
816
  const hasDebugClass =
607
- document.documentElement.classList.contains("standard-debug");
817
+ document.documentElement.classList.contains("stnd-debug");
608
818
 
609
819
  if (isBlueprint && !hasDebugClass) {
610
820
  // Blueprint theme activated - show grid overlays
@@ -992,10 +1202,10 @@
992
1202
  isColorValue(value) {
993
1203
  return value
994
1204
  ? value.startsWith("#") ||
995
- value.startsWith("rgb") ||
996
- value.startsWith("hsl") ||
997
- value.startsWith("oklch") ||
998
- value.includes("color-mix")
1205
+ value.startsWith("rgb") ||
1206
+ value.startsWith("hsl") ||
1207
+ value.startsWith("oklch") ||
1208
+ value.includes("color-mix")
999
1209
  : false;
1000
1210
  }
1001
1211
 
@@ -1089,9 +1299,9 @@
1089
1299
  ) {
1090
1300
  e.preventDefault();
1091
1301
 
1092
- document.documentElement.classList.toggle("standard-debug");
1302
+ document.documentElement.classList.toggle("stnd-debug");
1093
1303
  const isActive =
1094
- document.documentElement.classList.contains("standard-debug");
1304
+ document.documentElement.classList.contains("stnd-debug");
1095
1305
 
1096
1306
  // UPDATED: Save debug mode to sessionStorage
1097
1307
  this.saveDebugMode(isActive);
@@ -1167,39 +1377,39 @@
1167
1377
  const styles = document.createElement("style");
1168
1378
  styles.id = "standard-lab-styles";
1169
1379
  styles.textContent = `
1170
- .standard-lab-badge { font-family: var(--standard-lab-font-family); position: fixed; width: var(--space-half); height: var(--space-half); border-radius: 50%; background: var(--color-surface); border: var(--border); box-shadow: var(--shadow); backdrop-filter: var(--blur); cursor: pointer; z-index: var(--z-toast); line-height:1.5; display: flex; align-items: baseline; justify-content: center; color: var(--color-foreground); transition: all 0.2s ease; padding: 0; margin:0; }
1380
+ .standard-lab-badge { font-family: var(--stnd-lab-font-family); position: fixed; width: var(--space-d2); height: var(--space-d2); border-radius: 50%; background: var(--color-surface); border: var(--border); box-shadow: var(--shadow); backdrop-filter: var(--filter-blur); cursor: pointer; z-index: var(--z-toast); line-height:1.5; display: flex; align-items: baseline; justify-content: center; color: var(--color-foreground); transition: all 0.2s ease; padding: 0; margin:0; }
1171
1381
  .standard-lab-badge:hover { box-shadow: var(--shadow); transform: scale(1.05); color: var(--color-dark-accent); }
1172
1382
  .standard-lab-badge:active { transform: scale(0.95); }
1173
- .standard-lab-badge[data-modified]::after { content: attr(data-modified); position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent); color: var(--color-background); font-size: var(--scale-d3); display: flex; align-items: center; justify-content: center; font-weight: 600; border: var(--border); box-shadow:var(--shadow); }
1174
- .standard-lab-panel { position: fixed; background: var(--standard-lab-bg); color: var(--standard-lab-text); font-size: var(--standard-lab-text-size); border: var(--standard-lab-border); border-radius: 6px; box-shadow: var(--standard-lab-shadow); backdrop-filter: var(--standard-lab-blur); z-index: var(--z-toast); opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; display: flex; flex-direction: column; }
1175
- .standard-lab-panel * { font-family: var(--standard-lab-font-family) !important; font-size: inherit; line-height:1.5; margin:0; }
1383
+ .standard-lab-badge[data-modified]::after { content: attr(data-modified); position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-accent); color: var(--color-background); font-size: var(--size-xs); display: flex; align-items: center; justify-content: center; font-weight: 600; border: var(--border); box-shadow:var(--shadow); }
1384
+ .standard-lab-panel { position: fixed; background: var(--stnd-lab-bg); color: var(--stnd-lab-text); font-size: var(--stnd-lab-text-size); border: var(--stnd-lab-border); border-radius: 6px; box-shadow: var(--stnd-lab-shadow); backdrop-filter: var(--stnd-lab-blur); z-index: var(--z-toast); opacity: 0; transform: translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; display: flex; flex-direction: column; }
1385
+ .standard-lab-panel * { font-family: var(--stnd-lab-font-family) !important; font-size: inherit; line-height:1.5; margin:0; }
1176
1386
  .standard-lab-panel :is(label, input) { margin:0; }
1177
- .standard-lab-panel-quick { max-width: 280px; max-height: 400px; }
1387
+ .standard-lab-panel-quick { max-width: 300px; max-height: 80vh; overflow-y: auto; }
1178
1388
  .standard-lab-panel-full { max-width: 360px; max-height: 600px; }
1179
- .standard-lab-panel-header { padding: 6px; border-bottom: var(--standard-lab-border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
1180
- .standard-lab-panel-header h2 { margin: 0; font-size: calc(var(--standard-lab-text-size) * 1.167); font-weight: 600; letter-spacing: -0.02em; }
1181
- .standard-lab-viewport-info { font-size: calc(var(--standard-lab-text-size) * 0.917); font-weight: 400; color: var(--standard-lab-text); opacity: 0.7; margin-top: 2px; font-family: var(--font-monospace); }
1389
+ .standard-lab-panel-header { padding: 6px; border-bottom: var(--stnd-lab-border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
1390
+ .standard-lab-panel-header h2 { margin: 0; font-size: calc(var(--stnd-lab-text-size) * 1.167); font-weight: 600; letter-spacing: -0.02em; }
1391
+ .standard-lab-viewport-info { font-size: calc(var(--stnd-lab-text-size) * 0.917); font-weight: 400; color: var(--stnd-lab-text); opacity: 0.7; margin-top: 2px; font-family: var(--font-monospace); }
1182
1392
  .standard-lab-header-actions { display: flex; gap: 6px; }
1183
- .standard-lab-section { margin:0;padding: 4px; border-bottom: var(--standard-lab-border); }
1393
+ .standard-lab-section { margin:0;padding: 4px; border-bottom: var(--stnd-lab-border); }
1184
1394
  .standard-lab-section:last-of-type { border-bottom: none; }
1185
- .standard-lab-label { display: block; font-size: calc(var(--standard-lab-text-size) * 0.917); font-weight: 600; color: var(--standard-lab-text); opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
1395
+ .standard-lab-label { display: block; font-size: calc(var(--stnd-lab-text-size) * 0.917); font-weight: 600; color: var(--stnd-lab-text); opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
1186
1396
  .standard-lab-toggle { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
1187
1397
  .standard-lab-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; margin: 0; }
1188
- .standard-lab-toggle span { flex: 1; font-size: calc(var(--standard-lab-text-size) * 1.167); }
1189
- .standard-lab-toggle kbd { font-size: calc(var(--standard-lab-text-size) * 1); font-family: var(--font-monospace); color: var(--standard-lab-text); opacity: 0.6; padding: 2px 6px; background: rgba(0,0,0,0.1); border-radius: 6px; }
1190
- .standard-lab-select { width: 100%; padding: 6px 3px; margin:0 ; background: var(--standard-lab-bg); border: var(--standard-lab-border); border-radius: 6px; font-size: calc(var(--standard-lab-text-size) * 1.167); color: var(--standard-lab-text); cursor: pointer; }
1191
- .standard-lab-actions { padding: 6px; border-top: var(--standard-lab-border); display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
1192
- .standard-lab-btn { font-size: calc(var(--standard-lab-text-size) * 1.167); width: 100%; padding: 6px 3px; background: var(--standard-lab-accent); color: var(--standard-lab-bg); border: var(--standard-lab-border); border-radius: 6px; font-weight: 600; cursor: pointer; transition: opacity 0.2s ease; }
1398
+ .standard-lab-toggle span { flex: 1; font-size: calc(var(--stnd-lab-text-size) * 1.167); }
1399
+ .standard-lab-toggle kbd { font-size: calc(var(--stnd-lab-text-size) * 1); font-family: var(--font-monospace); color: var(--stnd-lab-text); opacity: 0.6; padding: 2px 6px; background: rgba(0,0,0,0.1); border-radius: 6px; }
1400
+ .standard-lab-select { width: 100%; padding: 6px 3px; margin:0 ; background: var(--stnd-lab-bg); border: var(--stnd-lab-border); border-radius: 6px; font-size: calc(var(--stnd-lab-text-size) * 1.167); color: var(--stnd-lab-text); cursor: pointer; }
1401
+ .standard-lab-actions { padding: 6px; border-top: var(--stnd-lab-border); display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
1402
+ .standard-lab-btn { font-size: calc(var(--stnd-lab-text-size) * 1.167); width: 100%; padding: 6px 3px; background: var(--stnd-lab-accent); color: var(--stnd-lab-bg); border: var(--stnd-lab-border); border-radius: 6px; font-weight: 600; cursor: pointer; transition: opacity 0.2s ease; }
1193
1403
  .standard-lab-btn:hover { opacity: 0.9; }
1194
1404
  .standard-lab-btn:active { opacity: 0.8; }
1195
- .standard-lab-btn-secondary { background: rgba(255,255,255,0.1); color: var(--standard-lab-text); border: var(--standard-lab-border); }
1196
- .standard-lab-btn-icon { font-size: calc(var(--standard-lab-text-size) * 1.667); width: 24px; height: 24px; padding: 0; background: transparent; border: none; color: var(--standard-lab-text); line-height: 1; cursor: pointer; border-radius: 6px; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; opacity: 0.7; }
1197
- .standard-lab-btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--standard-lab-text); opacity: 1; }
1198
- .standard-lab-tabs { display: flex; border-bottom: var(--standard-lab-border); flex-shrink: 0; }
1199
- .standard-lab-tab { flex: 1; padding: 6px; background: transparent; border: none; border-bottom: 2px solid transparent; font-size: calc(var(--standard-lab-text-size) * 1.333); font-weight: 500; color: var(--standard-lab-text); opacity: 0.6; cursor: pointer; transition: all 0.2s ease; }
1200
- .standard-lab-tab:hover { color: var(--standard-lab-text); opacity: 1; background: rgba(255,255,255,0.05); }
1201
- .standard-lab-tab[aria-selected="true"] { color: var(--standard-lab-accent); opacity: 1; border-bottom-color: var(--standard-lab-accent); font-weight: 600; }
1202
- .standard-lab-filter { padding: 6px 6px; background: rgba(255,255,255,0.05); border-bottom: var(--standard-lab-border); flex-shrink: 0; }
1405
+ .standard-lab-btn-secondary { background: rgba(255,255,255,0.1); color: var(--stnd-lab-text); border: var(--stnd-lab-border); }
1406
+ .standard-lab-btn-icon { font-size: calc(var(--stnd-lab-text-size) * 1.667); width: 24px; height: 24px; padding: 0; background: transparent; border: none; color: var(--stnd-lab-text); line-height: 1; cursor: pointer; border-radius: 6px; transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; opacity: 0.7; }
1407
+ .standard-lab-btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--stnd-lab-text); opacity: 1; }
1408
+ .standard-lab-tabs { display: flex; border-bottom: var(--stnd-lab-border); flex-shrink: 0; }
1409
+ .standard-lab-tab { flex: 1; padding: 6px; background: transparent; border: none; border-bottom: 2px solid transparent; font-size: calc(var(--stnd-lab-text-size) * 1.333); font-weight: 500; color: var(--stnd-lab-text); opacity: 0.6; cursor: pointer; transition: all 0.2s ease; }
1410
+ .standard-lab-tab:hover { color: var(--stnd-lab-text); opacity: 1; background: rgba(255,255,255,0.05); }
1411
+ .standard-lab-tab[aria-selected="true"] { color: var(--stnd-lab-accent); opacity: 1; border-bottom-color: var(--stnd-lab-accent); font-weight: 600; }
1412
+ .standard-lab-filter { padding: 6px 6px; background: rgba(255,255,255,0.05); border-bottom: var(--stnd-lab-border); flex-shrink: 0; }
1203
1413
  .standard-lab-content { flex: 1; overflow-y: auto; padding: 6px; }
1204
1414
  .standard-lab-content::-webkit-scrollbar { width: 6px; }
1205
1415
  .standard-lab-content::-webkit-scrollbar-track { background: transparent; }
@@ -1208,35 +1418,50 @@
1208
1418
  .standard-lab-token-list { display: flex; flex-direction: column; gap: 3px; }
1209
1419
  .standard-lab-token-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: start; padding: 6px; border-radius: 6px; transition: background 0.2s ease; }
1210
1420
  .standard-lab-token-row:hover { background: rgba(255,255,255,0.05); }
1211
- .standard-lab-token-row.is-modified { background: rgba(var(--standard-lab-accent-rgb, 255), 0.05); }
1212
- .standard-lab-text-input { padding: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: var(--standard-lab-text-size); font-family: var(--font-monospace); color: var(--standard-lab-text); min-width: 0; transition: all 0.2s ease; }
1213
- .standard-lab-text-input:focus { outline: none; background: rgba(255,255,255,0.05); border-color: var(--standard-lab-accent); }
1421
+ .standard-lab-token-row.is-modified { background: rgba(var(--stnd-lab-accent-rgb, 255), 0.05); }
1422
+ .standard-lab-text-input { padding: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: var(--stnd-lab-text-size); font-family: var(--font-monospace); color: var(--stnd-lab-text); min-width: 0; transition: all 0.2s ease; }
1423
+ .standard-lab-text-input:focus { outline: none; background: rgba(255,255,255,0.05); border-color: var(--stnd-lab-accent); }
1214
1424
  .standard-lab-color-container { width: 100%; }
1215
- .standard-lab-color-label { display: block; font-size: calc(var(--standard-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--standard-lab-text); opacity: 0.7; margin-bottom: 6px; }
1425
+ .standard-lab-color-label { display: block; font-size: calc(var(--stnd-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--stnd-lab-text); opacity: 0.7; margin-bottom: 6px; }
1216
1426
  .standard-lab-color-controls { display: flex; gap: 6px; align-items: center; }
1217
- .standard-lab-color-input { width: 40px; height: 40px; border: var(--standard-lab-border); border-radius: 6px; cursor: pointer; padding: 4px; background: rgba(255,255,255,0.05); flex-shrink: 0; }
1427
+ .standard-lab-color-input { width: 40px; height: 40px; border: var(--stnd-lab-border); border-radius: 6px; cursor: pointer; padding: 4px; background: rgba(255,255,255,0.05); flex-shrink: 0; }
1218
1428
  .standard-lab-color-input::-webkit-color-swatch-wrapper { padding: 0; }
1219
1429
  .standard-lab-color-input::-webkit-color-swatch { border: none; border-radius: 6px; }
1220
- .standard-lab-color-value { flex: 1; min-width: 0; padding: 0; font-family: var(--font-monospace); font-size: var(--standard-lab-text-size); }
1430
+ .standard-lab-color-value { flex: 1; min-width: 0; padding: 0; font-family: var(--font-monospace); font-size: var(--stnd-lab-text-size); }
1221
1431
  .standard-lab-text-container { width: 100%; }
1222
- .standard-lab-text-label { display: block; font-size: calc(var(--standard-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--standard-lab-text); opacity: 0.7; margin-bottom: 6px; }
1432
+ .standard-lab-text-label { display: block; font-size: calc(var(--stnd-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--stnd-lab-text); opacity: 0.7; margin-bottom: 6px; }
1223
1433
  .standard-lab-slider-container { width: 100%; }
1224
- .standard-lab-slider-label { display: block; font-size: calc(var(--standard-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--standard-lab-text); opacity: 0.7; margin-bottom: 6px; }
1434
+ .standard-lab-slider-label { display: block; font-size: calc(var(--stnd-lab-text-size) * 0.917); font-family: var(--font-monospace); color: var(--stnd-lab-text); opacity: 0.7; margin-bottom: 6px; }
1225
1435
  .standard-lab-slider-controls { display: flex; gap: 6px; align-items: center; }
1226
1436
  .standard-lab-slider-input { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,0.1); border-radius: 6px; outline: none; cursor: pointer; }
1227
- .standard-lab-slider-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: var(--standard-lab-accent); border-radius: 50%; cursor: grab; transition: transform 0.1s ease; }
1437
+ .standard-lab-slider-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; background: var(--stnd-lab-accent); border-radius: 50%; cursor: grab; transition: transform 0.1s ease; }
1228
1438
  .standard-lab-slider-input::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.2); }
1229
- .standard-lab-slider-input::-moz-range-thumb { width: 16px; height: 16px; background: var(--standard-lab-accent); border-radius: 50%; border: none; cursor: grab; transition: transform 0.1s ease; }
1439
+ .standard-lab-slider-input::-moz-range-thumb { width: 16px; height: 16px; background: var(--stnd-lab-accent); border-radius: 50%; border: none; cursor: grab; transition: transform 0.1s ease; }
1230
1440
  .standard-lab-slider-input::-moz-range-thumb:active { cursor: grabbing; transform: scale(1.2); }
1231
- .standard-lab-slider-value { width: 80px; flex-shrink: 0; text-align: center; padding: 6px 8px; font-size: var(--standard-lab-text-size); }
1441
+ .standard-lab-slider-value { width: 80px; flex-shrink: 0; text-align: center; padding: 6px 8px; font-size: var(--stnd-lab-text-size); }
1232
1442
  .standard-lab-btn-reset { opacity: 0; transition: opacity 0.2s ease; }
1233
1443
  .standard-lab-token-row:hover .standard-lab-btn-reset:not(:disabled) { opacity: 1; }
1234
1444
  .standard-lab-btn-reset:disabled { opacity: 0; cursor: not-allowed; }
1235
- .standard-lab-empty { padding: 6px; text-align: center; color: var(--standard-lab-text); opacity: 0.6; font-size: calc(var(--standard-lab-text-size) * 1.167); }
1236
- .standard-lab-notification { position: fixed; top: 6px; left: 50%; transform: translateX(-50%) translateY(-10px); background: var(--standard-lab-bg); border: var(--standard-lab-border); border-radius: 6px; padding: 8px 16px; box-shadow: var(--standard-lab-shadow); z-index: calc(var(--z-toast) + 1); font-size: calc(var(--standard-lab-text-size) * 1.167); opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none; }
1237
- .standard-lab-notification-success { background: var(--standard-lab-accent); color: var(--standard-lab-bg); border-color: var(--standard-lab-accent); }
1238
- .standard-lab-notification-info { background: var(--standard-lab-accent); color: var(--standard-lab-bg); border-color: var(--standard-lab-accent); }
1239
- @media (prefers-color-scheme: dark) { .standard-lab-panel { box-shadow: var(--standard-lab-shadow); } }
1445
+ .standard-lab-seed-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
1446
+ .standard-lab-seed-row:last-child { margin-bottom: 0; }
1447
+ .standard-lab-color-swatch { width: 28px; height: 28px; border: var(--stnd-lab-border); border-radius: 4px; cursor: pointer; padding: 2px; background: rgba(255,255,255,0.05); flex-shrink: 0; }
1448
+ .standard-lab-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
1449
+ .standard-lab-color-swatch::-webkit-color-swatch { border: none; border-radius: 2px; }
1450
+ .standard-lab-seed-input { flex: 1; min-width: 0; padding: 2px 4px; background: transparent; border: 1px solid transparent; border-radius: 4px; font-family: var(--stnd-lab-font-family); font-size: var(--stnd-lab-text-size); color: var(--stnd-lab-text); transition: border-color 0.2s ease; }
1451
+ .standard-lab-seed-input:focus { outline: none; background: rgba(255,255,255,0.05); border-color: var(--stnd-lab-accent); }
1452
+ .standard-lab-seed-tag { font-size: calc(var(--stnd-lab-text-size) * 0.833); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.5; flex-shrink: 0; width: 20px; text-align: right; }
1453
+ .standard-lab-font-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
1454
+ .standard-lab-font-row:last-child { margin-bottom: 0; }
1455
+ .standard-lab-font-tag { font-size: calc(var(--stnd-lab-text-size) * 0.833); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.5; flex-shrink: 0; width: 32px; }
1456
+ .standard-lab-quick-slider { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
1457
+ .standard-lab-quick-slider:last-child { margin-bottom: 0; }
1458
+ .standard-lab-quick-slider .standard-lab-slider-input { flex: 1; }
1459
+ .standard-lab-slider-readout { font-family: var(--stnd-lab-font-family); font-size: var(--stnd-lab-text-size); opacity: 0.8; flex-shrink: 0; width: 48px; text-align: right; }
1460
+ .standard-lab-empty { padding: 6px; text-align: center; color: var(--stnd-lab-text); opacity: 0.6; font-size: calc(var(--stnd-lab-text-size) * 1.167); }
1461
+ .standard-lab-notification { position: fixed; top: 6px; left: 50%; transform: translateX(-50%) translateY(-10px); background: var(--stnd-lab-bg); border: var(--stnd-lab-border); border-radius: 6px; padding: 8px 16px; box-shadow: var(--stnd-lab-shadow); z-index: calc(var(--z-toast) + 1); font-size: calc(var(--stnd-lab-text-size) * 1.167); opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; pointer-events: none; }
1462
+ .standard-lab-notification-success { background: var(--stnd-lab-accent); color: var(--stnd-lab-bg); border-color: var(--stnd-lab-accent); }
1463
+ .standard-lab-notification-info { background: var(--stnd-lab-accent); color: var(--stnd-lab-bg); border-color: var(--stnd-lab-accent); }
1464
+ @media (prefers-color-scheme: dark) { .standard-lab-panel { box-shadow: var(--stnd-lab-shadow); } }
1240
1465
  @media (max-width: 768px) { .standard-lab-panel-quick, .standard-lab-panel-full { width: calc(100vw - 32px); max-width: 360px; } }
1241
1466
  @media print { .standard-lab-badge, .standard-lab-panel, .standard-lab-notification { display: none !important; } }
1242
1467
  `;
@@ -1258,18 +1483,14 @@
1258
1483
 
1259
1484
  if (!window.StandardLab) {
1260
1485
  window.StandardLab = new StandardLab();
1261
- if (window.StandardLab.log) {
1262
- window.StandardLab.log.info("Initialized");
1263
- }
1486
+ console.log("[StandardLab] ✓ Initialized");
1264
1487
  }
1265
1488
 
1266
1489
  // Handle HTMX swaps - Setup here to ensure document.body exists
1267
1490
  if (document.body) {
1268
1491
  document.body.addEventListener("htmx:afterSettle", () => {
1492
+ console.log("[StandardLab] ⚡ HTMX swap detected");
1269
1493
  if (window.StandardLab) {
1270
- if (window.StandardLab.log) {
1271
- window.StandardLab.log.debug("HTMX swap detected");
1272
- }
1273
1494
  window.StandardLab.refresh();
1274
1495
  }
1275
1496
  });
@@ -1284,12 +1505,10 @@
1284
1505
 
1285
1506
  // Handle Astro ClientRouter page swaps - MUST check root container
1286
1507
  document.addEventListener("astro:after-swap", () => {
1287
- const l = (window.StandardLab && window.StandardLab.log) || console;
1288
- if (l.debug) l.debug("Page swap detected");
1508
+ console.log("[StandardLab] 🔄 Page swap detected");
1289
1509
 
1290
1510
  if (!window.StandardLab) {
1291
- const l = (window.standard && window.standard.log) || console;
1292
- if (l.warn) l.warn("Instance not found, reinitializing");
1511
+ console.log("[StandardLab] ⚠️ Instance not found, reinitializing");
1293
1512
  window.StandardLab = new StandardLab();
1294
1513
  return;
1295
1514
  }
@@ -1299,9 +1518,7 @@
1299
1518
 
1300
1519
  // If badge is gone, recreate it
1301
1520
  if (!badge) {
1302
- if (window.StandardLab.log) {
1303
- window.StandardLab.log.debug("Recreating badge");
1304
- }
1521
+ console.log("[StandardLab] 🔨 Recreating badge");
1305
1522
  window.StandardLab.badge = null;
1306
1523
  window.StandardLab.createBadge();
1307
1524
  }
@@ -1320,7 +1537,7 @@
1320
1537
  window.StandardLab.restoreDebugMode();
1321
1538
 
1322
1539
  // Re-inject debug overlays if needed
1323
- if (document.documentElement.classList.contains("standard-debug")) {
1540
+ if (document.documentElement.classList.contains("stnd-debug")) {
1324
1541
  window.StandardLab.injectGridDebugOverlays();
1325
1542
  }
1326
1543
  });