Compare commits

...
Author SHA1 Message Date
Claude 3551b4bd78 Fix light card icon disappearing on older iOS
The light button and its icon were sized with percentages that only
resolve through the intrinsic size of the icon SVG. When that size is
computed as 0, as older WebKit versions can do, the whole button
collapses and the icon disappears. Size them from the button width with
container units instead, keeping the previous sizing as a fallback.

Fixes #53895

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017jKiCJqPA8x9uWLMw7SXqa
2026-10-27 07:11:29 +00:00
@@ -322,6 +322,17 @@ export class HuiLightCard extends LitElement implements LovelaceCard {
--mdc-icon-size: 100%;
}
/* Percentage sizes only resolve here through the intrinsic size of the
icon, which older WebKit versions can compute as 0 and hide the icon.
Size the button and the icon from the button width instead. */
@supports (width: 1cqi) {
.light-button {
container-type: inline-size;
--ha-icon-button-size: 100cqi;
--mdc-icon-size: 100cqi;
}
}
.light-button.state-on {
color: var(--state-light-active-color);
}