Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: rgba not working in template card #1500

Open
3 tasks done
ech58 opened this issue Aug 16, 2024 · 2 comments
Open
3 tasks done

[Bug]: rgba not working in template card #1500

ech58 opened this issue Aug 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ech58
Copy link

ech58 commented Aug 16, 2024

Requirements

  • I checked the troubleshooting section in the README to verify that I have the latest Mushroom version.
  • I did a search to see if there is a similar issue or if a pull request is open.
  • I have read the state of card mod support (in pin issues) and understand card mod support is not provided in this repository.

Current Behavior

Hello,
I use rgba function in a template to set the icon color in a template mushroom badge. It's working very well.
I do the same with the mushroom template card and it is not working (works only with color names and hexa codes)

Expected Behavior

Should have the same behaviorin template badge and in template card ?

Steps To Reproduce

No response

Context

YAML state

Environment

- Browser:
- HA Version:
- Mushroom:

Anything else?

No response

@ech58 ech58 added the bug Something isn't working label Aug 16, 2024
@piitaya piitaya added enhancement New feature or request bug Something isn't working and removed bug Something isn't working enhancement New feature or request labels Aug 27, 2024
@Matssa56
Copy link

Matssa56 commented Sep 1, 2024

Hi quick question, you managed to use theme variables or rgba directly in a template chip card? I can't seem to make it work, it only works with hex :

type: custom:mushroom-chips-card
chips:
  - type: template
    entity: switch.prise_television
    tap_action:
      action: toggle
    icon: |-
      {% if states(entity) == "on" %}
        mdi:television
      {% else %}
        mdi:television-off
      {% endif %}
    icon_color: |-
      {% if states(entity) == "unavailable" %}
        grey
      {% elif states(entity) == "on" %}
        var(--color-card-blue)
      {% endif %}
    hold_action:
      action: more-info

Wanted to make sure before openning an issue. Thanks!

@ech58
Copy link
Author

ech58 commented Sep 3, 2024

Hello,

I do not use theme variables, I try to use the rgba function directly in the template chip card.

Thank you for your answer and your help.
Eric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants