ha-icon { color: var(--secondary-text-color, #9aa0aa); }
- .dev.sel .device-shell {
- border-color: #0C82F0;
- box-shadow:
- 0 0 0 2px var(--card-background-color, #fff),
- 0 0 0 4px rgb(12 130 240 / 65%),
- 0 4px 8px -1.07px rgb(37 40 45 / 18%);
+ .dev.sel {
+ --device-ring-color: #F0A00C;
+ --device-ring-width: calc(var(--dev-size) * 0.0375);
}
- .dev:focus-visible .device-shell {
- border-color: #0C82F0;
- box-shadow:
- 0 0 0 3px rgb(12 130 240 / 42%),
- 0 0 0 6px rgb(12 130 240 / 18%),
- 0 4px 8px -1.07px rgb(37 40 45 / 18%);
+ .dev:focus-visible {
+ --device-ring-color: #0C82F0;
+ --device-ring-width: calc(var(--dev-size) * 0.0375);
+ }
+ .dev:not(.on):not(.open):not(.alarm):not(.lock-locked):not(.lock-unlocked):not(.unavail):focus-visible {
+ --device-face-fg: #0C82F0;
}
/* Alert stays above focus, selection, hover and ordinary semantic paint. */
- .dev.alarm .device-core,
- .dev.alarm:hover .device-core,
- .dev.alarm:focus-visible .device-core {
- background: #F0410C;
- color: #fff;
+ .dev.alarm,
+ .dev.alarm:hover,
+ .dev.alarm:focus-visible {
+ --device-face-bg: #F0410C;
+ --device-face-fg: light-dark(#fff, #252525);
+ --device-shell-stroke: #F0410C;
}
- .dev.alarm .device-shell,
- .dev.alarm:hover .device-shell,
- .dev.alarm:focus-visible .device-shell {
- border-color: #F0410C;
- box-shadow: 0 0 0 3px rgb(240 65 12 / 24%),
- 0 4px 8px -1.07px rgb(37 40 45 / 18%);
+ .dev.theme-light.alarm { --device-face-fg: #fff; }
+ .dev.theme-dark.alarm {
+ --device-face-fg: #252525;
+ --device-shell-stroke-ratio: .025;
}
.dev .value-badge {
@@ -2855,7 +2901,7 @@ globalThis.__HOUSEPLAN_BUILD_FINGERPRINT__="c80008b7bfa2031d1b7f7931429102e39c82
overflow: visible;
background: var(--device-core-bg);
border: 0;
- border-radius: calc(var(--dev-size, var(--icon-size, 2.5cqw)) * 0.18);
+ border-radius: calc(var(--dev-size, var(--icon-size, 2.5cqw)) * 0.39375);
padding: 0 calc(var(--dev-size, var(--icon-size, 2.5cqw)) * 0.14);
font-size: calc(var(--dev-size, var(--icon-size, 2.5cqw)) * var(--value-font-scale, .45));
font-weight: 600;
diff --git a/demo/capture_device_icon_reference.mjs b/demo/capture_device_icon_reference.mjs
new file mode 100644
index 00000000..07bfb30e
--- /dev/null
+++ b/demo/capture_device_icon_reference.mjs
@@ -0,0 +1,193 @@
+#!/usr/bin/env node
+// Issue #211: human-reviewable Reference SVG <-> Runtime matrix.
+import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { mdiLightbulbSpot } from '@mdi/js';
+import { launch } from './serve.mjs';
+
+const artifactDir = resolve('artifacts/device-icon-reference');
+mkdirSync(artifactDir, { recursive: true });
+
+const referenceAsset = (theme, file, coreSize) => {
+ let source = readFileSync(resolve('demo/srv/reference/device-icons', theme, file), 'utf8');
+ if (theme === 'Dark' && file === 'Unlock.svg') source = source.replaceAll('#1DC21D', '#F0A00C');
+ const nativeWidth = Number(source.match(/