Most dark mode browser extensions rely on naive filter: invert(1) hacks or legacy rgb()/hsl() regexes that fall apart on modern UI frameworks like Tailwind v4 and Cloudflare Kumo.
While building GruvDark, solving modern dashboards required three distinct subsystems:
- Native CSS Color 4 Remapping: Parsing
oklch(),oklab(), andcolor()spaces directly into perceptual lightness so surfaces map cleanly onto Gruvbox (#1d2021,#282828,#ebdbb2). - Ring Box-Shadow Preservation: Detecting zero-blur
box-shadowhairlines (remapRingBoxShadow()) used as card and table borders instead of stripping them out. - Smart Canvas Sampling: Inspecting canvas pixel luminance (
processCanvas()) before inverting light-mode ECharts while leaving dark canvases and WebGL contexts untouched.