Skip to content

lock spark: inline-flex icon, CSS color vars, ha-tile-icon defaults#197

Merged
dcapslock merged 5 commits intodevfrom
copilot/update-lock-icon-display-again
Apr 9, 2026
Merged

lock spark: inline-flex icon, CSS color vars, ha-tile-icon defaults#197
dcapslock merged 5 commits intodevfrom
copilot/update-lock-icon-display-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 9, 2026

Three targeted improvements to the lock spark icon rendering and ha-tile-icon target handling.

Changes

Icon display

  • display changed from inline-blockinline-flex

CSS color variables

Icon color now resolves through a priority chain, giving full CSS-level control per lock state:

config value
  → --uix-lock-icon-locked-color / --uix-lock-icon-unlocked-color / --uix-lock-icon-blocked-color
    → --uix-lock-icon-color
      → HA theme default (--success-color / --error-color)

Config-supplied icon_locked_color / icon_unlocked_color still take precedence over CSS vars.

ha-tile-icon target defaults

LockTargetAdapter interface extended with defaultIconPadding(), defaultIconBorderRadius(), and defaultIconPosition(); HaTileIconLockAdapter provides compact defaults appropriate for the element's size:

Property Default
icon_size 12px (was 18px)
padding 2px
border-radius 50% (pill/circular background)
position top: 3px, left: 3px

These apply only when the respective config option is not explicitly set, and are overridable via --uix-lock-icon-padding / --uix-lock-icon-border-radius / icon_position as usual.

Copy link
Copy Markdown
Collaborator

@dcapslock dcapslock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the lock target is ha-tile-info set the default --uix-lock-icon-border-radius to 50% for a pill background

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 9, 2026

When the lock target is ha-tile-info set the default --uix-lock-icon-border-radius to 50% for a pill background

Done in 1265fae. Added defaultIconBorderRadius() to the LockTargetAdapter interface and implemented it in HaTileIconLockAdapter returning "50%". The border-radius is applied as var(--uix-lock-icon-border-radius, 50%) when the target is ha-tile-icon, so it can still be overridden via the CSS variable.

Copilot AI requested a review from dcapslock April 9, 2026 10:31
@dcapslock dcapslock marked this pull request as ready for review April 9, 2026 10:37
@dcapslock dcapslock merged commit 701227b into dev Apr 9, 2026
3 of 4 checks passed
@dcapslock dcapslock deleted the copilot/update-lock-icon-display-again branch April 9, 2026 10:40
github-actions bot pushed a commit that referenced this pull request Apr 9, 2026
## [6.2.0-beta.5](v6.2.0-beta.4...v6.2.0-beta.5) (2026-04-09)

### ⭐ New Features

* **lock-spark:** add color CSS vars for lock icon and set defaults when target is ha-tile-icon ([#197](#197)) ([701227b](701227b))
* **map-spark:** Add map spark tour mode ([#196](#196)) ([5a6db26](5a6db26))
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🎉 This PR is included in version 6.2.0-beta.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants