// Assist textfield readability — v5. // // The new ha-input wraps Web Awesome (wa-input). Web Awesome is a separate // component system that renders LIGHT by default unless told to be dark via: // 1) adding the "wa-dark" class on the root / document element, or // 2) setting its own --wa-* CSS color tokens at :root. // // HA's dark theme flag doesn't propagate to it, so we do both: force wa-dark // class on the html element AND override the wa color tokens to match the // active HA theme. Plus inline-style belt-and-suspenders on the actual input. (function () { if (window.__assistFixLoaded) return; window.__assistFixLoaded = true; function v(name, fallback) { const x = getComputedStyle(document.documentElement) .getPropertyValue(name).trim(); return x || fallback; } function applyGlobalTokens() { const fg = v('--primary-text-color', '#e7e9f4'); const bg = v('--card-background-color', 'rgba(22, 24, 40, 0.92)'); const bgElev = v('--secondary-background-color', 'rgba(30, 32, 50, 0.95)'); const muted = v('--secondary-text-color', '#9a9cb8'); const border = v('--divider-color', 'rgba(255,255,255,0.20)'); const accent = v('--primary-color', '#a78bfa'); // 1. Force Web Awesome dark mode class on the html element document.documentElement.classList.add('wa-dark'); // 2. Inject/refresh a