Skip to content

fix: style for icon[loc=right]#1321

Open
ildar170975 wants to merge 1 commit intokalkih:devfrom
ildar170975:align-icon
Open

fix: style for icon[loc=right]#1321
ildar170975 wants to merge 1 commit intokalkih:devfrom
ildar170975:align-icon

Conversation

@ildar170975
Copy link
Copy Markdown
Collaborator

When a name is hidden and align_icon: right, we can see an icon left-aligned:

  - type: custom:mini-graph-card
    entities:
      - sensor.xxx
    show:
      name: false
    align_icon: right
image

After the fix:
image

@ildar170975 ildar170975 linked an issue Dec 12, 2025 that may be closed by this pull request
@ildar170975 ildar170975 marked this pull request as ready for review December 12, 2025 03:41
@akloeckner
Copy link
Copy Markdown
Collaborator

While this seems a straightforward fix, I'm wondering why align_icon: state also right-aligns but uses a different CSS. Should this be consistent? Or is there a reason, it's different?

@ildar170975
Copy link
Copy Markdown
Collaborator Author

While this seems a straightforward fix, I'm wondering why align_icon: state also right-aligns but uses a different CSS. Should this be consistent? Or is there a reason, it's different?

@akloeckner
Sorry for a long delay.

What we have now:

align_icon: state
image

align_icon: left
image

align_icon: right
image

The align_icon: state case places an icon into the same container as a state.
Note that in align_icon: left/right cases the icon is placed into the same container as a name (which may be missing).
And if a state is missing with align_icon: state - then the icon is not shown at all:

image

I would say that this is normal that an icon is not shown - because we explicitly "bound" it to a state - which we decided not to show.

Also note that in RTL for align_icon: state an icon will be in a left, a state will be in a right side.

As for align_icon: left/right cases, they should be modified for RTL, this should be a different additional fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align_icon + show.name interaction

2 participants