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]: primary-text-color no longer working? #1355

Closed
2 tasks done
walk0080 opened this issue Feb 1, 2024 · 12 comments
Closed
2 tasks done

[Bug]: primary-text-color no longer working? #1355

walk0080 opened this issue Feb 1, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@walk0080
Copy link

walk0080 commented Feb 1, 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.

Current Behavior

*** UPDATE: Tried reverting back to previous version using HACS with no luck... but after several attempts going back to 3.3.0, this is working again. Seems a bug introduced with latest 3.4.0 version? ***

As of today, the text just stays white and does not change based on state.

Not sure if this is specifically an issue with card-mod, or mushroom-template (both are using latest versions installed via HACS).

Screen cap from phone before HA refreshed:
IMG_1727

Screen cap from tablet showing colours missing:
IMG_1794

Expected Behavior

Certain text should be colour coded green (for yes) and red (for no).

This was working yesterday. Seems to be an issue on iOS/iPadOS Companion App, mobile and desktop browsers.

Steps To Reproduce

Loaded up HA in Companion App this morning and text colours no longer change.

My phone was showing correct colours until I forced a Lovelace reload and then colours were gone.

Same issue on both HA Companion app on iPadOS/iOS, mobile Safari and desktop Chrome.

Context

YAML state

          - type: custom:mushroom-template-card
            primary: |-
              {% set state=states('input_boolean.dog_henry_feeding_required') %}
              {% if state=='on' %}
                Yes
              {% else %}
                No
              {% endif %}
            secondary: Feed Reqd?
            icon: ''
            entity: input_boolean.dog_henry_feeding_required
            icon_color: white
            tap_action:
              action: more-info
            hold_action:
              action: more-info
            double_tap_action:
              action: more-info
            multiline_secondary: false
            fill_container: false
            card_mod:
              style:
                mushroom-state-info $: |
                  .container {
                    --card-secondary-font-size: 14px;
                    --card-primary-font-size: 16px;
                  }
                .: |
                  ha-card {
                    {% set state=states('input_boolean.dog_henry_feeding_required') %}
                    {% if state=='on' %}
                      --primary-text-color: red
                    {% else %}
                      --primary-text-color: green
                    {% endif %}
                    }

Environment

- Browser: Safari (iPadOS 17.3, iOS 17.3)
- HA Version: Core 2024.1.6 | Frontend 20240104.0
- Mushroom: 3.4.0
- Card-Mod: 3.4.2

Anything else?

I posted on the code-mod Github as well: lovelace-card-mod Gifthub Issue 356

@djjoakim
Copy link

djjoakim commented Feb 1, 2024

I can confirm this problem, it happend with the latest mushroom update - i reversed back to 3.3.0 and it's working again.

@walk0080
Copy link
Author

walk0080 commented Feb 1, 2024

Does in fact work with a standard HA card.

Went back to the previous version and was not resolved -- Will try 3.3.0 again.

type: entity
entity: input_boolean.dog_henry_feeding_required
card_mod:
  style: |
    ha-card {
      {% set state=states('input_boolean.dog_henry_feeding_required') %}
      {% if state=='on' %}
        --primary-text-color: red
      {% else %}
        --primary-text-color: green
      {% endif %}
      }

IMG_1796

@walk0080
Copy link
Author

walk0080 commented Feb 1, 2024

I can confirm this problem, it happend with the latest mushroom update - i reversed back to 3.3.0 and it's working again.

Tried going back to 3.3.0 mushroom and it does in fact work again. Not sure why previous attempts to revert back to 3.3.0 in HACS did not work even after clearing cache in HA Companion App. Thank you.

IMG_1798

@sdholden28
Copy link

There are definitlely issues related to card_mod. I had to revert back to 3.3 as well. I have a number of cards with larger font size set via card_mod. Prior to 3.4, the cards scale in size to match the font size. On 3.4, the cards revert to normal size and the text with the larger font size gets clipped.

@robertboccia
Copy link

Same problem with text colour using card mod, wonder when this will be fixed?

@margatemarcel
Copy link

I have the same problem and have reverted to v3.3.0 for now.

@julianfs
Copy link

julianfs commented Feb 5, 2024

I also have the same issue, resolved by rolling back to v3.3.0.

@piitaya
Copy link
Owner

piitaya commented Feb 6, 2024

Hi 👋 Some theme variables have been changed to use the default font style of tile card (https://github.com/piitaya/lovelace-mushroom/pull/1348/files#diff-47d2527b2c38615d2cd4f5c1c06a18c0bdb9b66519e468bba99344b5d9cadd6fR19-R26)
Mushroom support with card mod is not guarantee because it's not officially supported but you can find help in the community forum

I close this issue as card mod support is not provided in this repo.

@piitaya piitaya closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
@walk0080
Copy link
Author

walk0080 commented Feb 6, 2024

That's unfortunate. Is there a workaround that you are aware of?

@rindlerblabla
Copy link

rindlerblabla commented Feb 6, 2024

That's unfortunate. Is there a workaround that you are aware of?

The "workaround" was posted in the link above. Here's the solution. #1348 (comment)

@piitaya
Copy link
Owner

piitaya commented Feb 6, 2024

When you have card mod issues, don't hesitate to look at the forum https://community.home-assistant.io/t/mushroom-cards-build-a-beautiful-dashboard-easily/388590 😊

@walk0080
Copy link
Author

walk0080 commented Feb 6, 2024

Thank you - it does indeed work correctly with latest mushroom card version using --card-primary-color per #1348 (comment)

            card_mod:
              style:
                mushroom-state-info $: |
                  .container {
                    --card-secondary-font-size: 14px;
                    --card-primary-font-size: 16px;
                  }
                .: |
                  ha-card {
                    {% set state=states('input_boolean.dog_henry_feeding_required') %}
                    {% if state=='on' %}
                      --card-primary-color: red
                    {% else %}
                      --card-primary-color: green
                    {% endif %}
                    }

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

8 participants