fix(panel): make the icon field match the panel's own inputs - #862
Merged
Conversation
ha-icon-picker is HA's component, so it rendered with a Material shell — grey fill, dark underline, square bottom corners and a 56px box — next to 31/37px tm-inputs styled by the panel. Wrap it in a .tm-icon-well that carries the tm-input frame and strip the picker back to transparent. The fill and indicator line are var() usages inside ha-picker-field, so overriding them from the light DOM reaches them. The 56px row height and the square bottom corners are hard-set on ha-combo-box-item inside the shadow root and no variable overrides them, hence the fixed-height well with overflow:hidden and the half-difference offset. Search, the dropdown and clearing are untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ha-icon-pickeris Home Assistant's own component, so in the panel's dialogs it rendered with a Material shell — grey fill, dark active-indicator line, square bottom corners and a 56px box — sitting beside 37pxtm-inputs styled by the panel. It read as a borrowed control rather than part of the form.It is kept (the searchable MDI list is worth it) but wrapped in a
.tm-icon-wellthat carries thetm-inputframe, with the picker itself stripped back to transparent.Before / after
How
var()usages insideha-picker-field, so overriding--ha-color-form-backgroundand--ha-color-border-neutral-loudfrom the light DOM does reach them.ha-combo-box-iteminside the shadow root, and no variable overrides them. So the well is a fixedtm-input-height box withoverflow:hidden, and the picker is pulled up by half the difference to keep its contents optically centred. That offset is the fragile bit — if HA changes the 56px row height the icon drifts — and it is commented in the CSS.--mdc-text-field-*overrides are kept alongside for older HA, which still renders an mwc textfield here.Scope
This changes the shared
_iconPickerFieldhelper, so every dialog using it is covered: reward, chore, badge, quest, challenge and child avatar. The settings page'spoints_iconpicker and the notification period rows build their own markup and are left alone.Testing
Verified on the live ha-dev instance, not just locally:
starfilters it,✕clears.Not verified: dark theme has no screenshot — the browser profile's own theme setting overrides
frontend.set_themeon ha-dev. The well is built from the same tokens as.tm-input(--tm-surface-0,--tm-border,--tm-accent), so it tracks the theme the way the other inputs do by construction.