← back to Retrowalls
pre-hydrate density --cols CSS var before first paint — eliminates 6→saved flash on reload
15614c6a90f1fa81f6f9538bbcdfcfb569f7269d · 2026-05-25 21:32:11 -0700 · Steve Abrams
Files touched
Diff
commit 15614c6a90f1fa81f6f9538bbcdfcfb569f7269d
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon May 25 21:32:11 2026 -0700
pre-hydrate density --cols CSS var before first paint — eliminates 6→saved flash on reload
---
public/index.html | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/public/index.html b/public/index.html
index 8acec29..6671ae2 100644
--- a/public/index.html
+++ b/public/index.html
@@ -638,6 +638,12 @@ const HOSTKEY = location.hostname.replace(/\./g, '_');
document.documentElement.dataset.view = state.view;
const savedSort = localStorage.getItem(HOSTKEY + '_sort');
if (savedSort) state.sort = savedSort;
+ // Hydrate density CSS var BEFORE first paint so the grid renders at the
+ // saved column count instead of flashing the default 6 → saved value.
+ const savedDensity = parseInt(localStorage.getItem('rw_theme_density') || '6', 10);
+ if (savedDensity >= 4 && savedDensity <= 12) {
+ document.documentElement.style.setProperty('--cols', savedDensity);
+ }
} catch(e){}
})();
const LABELS = {"all":"All"};
← f096823 redact p.vendor on Ideas rail — replace with 'Designer Wallc
·
back to Retrowalls
·
rails: wire /api/sliders into horizontal scroll-snap rail se 2049623 →