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

READ THIS FIRST! - CARD-MOD 3.4.0 IS NOT WORKING? #332

Open
1 task done
thomasloven opened this issue Dec 29, 2023 · 25 comments
Open
1 task done

READ THIS FIRST! - CARD-MOD 3.4.0 IS NOT WORKING? #332

thomasloven opened this issue Dec 29, 2023 · 25 comments

Comments

@thomasloven
Copy link
Owner

If card-mod 3.4.0 is not working for you, please check your configuration.

style: |
  ... styles go here...

has not been the recommended way to do things for more than two years and has been causing trouble since the start, so I didn't think twice about removing it.

If you have that in your configuration, use the following instead:

card_mod:
  style: |
    ...styles go here...

You know... as it says in the readme.
...which you claim to have re-read when you check the box at the bottom of the issue template:

It's really there to avoid wasting both of our time 😉

@thomasloven thomasloven pinned this issue Dec 29, 2023
@thomasloven thomasloven changed the title CARD-MOD 3.4.0 IS NOT WORKING! READ THIS FIRST - CARD-MOD 3.4.0 IS NOT WORKING! Dec 29, 2023
@thomasloven thomasloven changed the title READ THIS FIRST - CARD-MOD 3.4.0 IS NOT WORKING! READ THIS FIRST! - CARD-MOD 3.4.0 IS NOT WORKING? Dec 29, 2023
@Phoenix-DH
Copy link

@thomasloven
Thanks a lot for this! I was wondering what I missed, but this solved my issue!
Thank you!

@ghallford

This comment was marked as off-topic.

@ghallford

This comment was marked as off-topic.

@thomasloven

This comment was marked as off-topic.

@dafunkydan
Copy link

Thanks for your continious Work on this awesome Component!
No Issue, but Question for Recommendations: Is there a Best-Practice how to adapt all Settings to the (not new, but) new Configuration (semi-)automated?
Looking at my Dashboard-Code, there are >900 (!!) Places with style: |, different configurations, and without card_mod.

Now i would need to add the card_mod Line, and add everywhere manually 2 Spaces for correct indentation. How did you and all handle that, are you using a special RegEx or similar to do that? I would love to avoid those hours of stupid spacebar-hitting... ;-)

@thomasloven
Copy link
Owner Author

Well. A good editor, like Visual Studio Code (or vim), should let you indent a whole block by selecting it and pressing tab (or >) once.
That's a start.

@ghallford
Copy link

ghallford commented Dec 31, 2023 via email

@dafunkydan
Copy link

dafunkydan commented Dec 31, 2023

Thanks guys! Im used to notepad++, but since it would take me 3+ hrs to go through everything (even with doing it in blocks), I thought there is maybe a more automated way... Anyway, if there's nothing u guys are aware of, I have some meditational work to do in the morning 😀

@brinkgit
Copy link

brinkgit commented Jan 4, 2024

Hello,

I cannot get the new card-mod 3.4.0 working.

I use the code:

    type: custom:mushroom-template-card
    primary: ''
    secondary: ''
    icon: mdi:arrow-left-bold
    icon_color: '#A49B9B'
    card_mod:
      style: |
        ha-card {margin-left: '-10px'; width: 70px;border: solid 0px ;
        background: rgba(0,0,0,0)}

What ever part do change, nothing happens in the layout of the card.
In the old version (3.3) it worked well.

Even if I do copy/paste the lines from the manual in a new card:

  card_mod:
  style: |
    ha-card {
      color: red;
    }

Nothing red comes up.

Card-mot is installed (actualy:updated).
I tried with and without

frontend:
  extra_module_url:
    - /local/card-mod.js

in th config yaml

What do I do wrong?

@ildar170975
Copy link
Contributor

ildar170975 commented Jan 4, 2024

@brinkgit
Compare your
image
with what is written in Docs in fact:
image

@brinkgit
Copy link

brinkgit commented Jan 4, 2024

I dis as you mentioned above:

Scherm­afbeelding 2024-01-04 om 17 53 43

@ildar170975
Copy link
Contributor

@brinkgit
It does work:
image
If you do not have it working - this could be a bug (which you need to prove as a bug) or a wrong use.
Suggest to ask similar questions in the dedicated HA community thread, you will definitely attract more people.

@DrSpaldo
Copy link

DrSpaldo commented Jan 7, 2024

I am not sure if mine is correct, this is my config and since 3.4 (and HA 2024.1) it has stopped working properly. I am not getting the reduced spacing I have been previously getting. My config is not the first one you posted @thomasloven but it is also not the second, it is somewhere in between....

type: custom:vertical-stack-in-card
view_layout:
  column: 2
cards:
  - type: glance
    card_mod:
      style:
        .entities:
          .entity:
            $: |
              state-badge {
                margin-top: 20px;
                margin-bottom: -5px;
              }
              .name {
                margin-top: 0px !important;
                margin-bottom: -10px !important;
              }
              div:not(.name) {
                margin-bottom: 0px !important;
              }
    entities:
      - entity: camera.frontroad
        name: Front 1
        show_state: false
      - entity: camera.frontdoor
        name: Front 2
        show_state: false
      - entity: camera.frontdriveway
        name: Front 3
        show_state: false

@ildar170975
Copy link
Contributor

I am not sure if mine is correct

No need to post here since it is unrelated to the topic.
Ask in the huge main card-mod HA Community thread.

@DrSpaldo
Copy link

DrSpaldo commented Jan 7, 2024

Since it stopped working on this release and the differences in the OP are similar, it looks related to the topic to me..

@KTibow
Copy link
Contributor

KTibow commented Jan 8, 2024

I'm surprised that nobody has mentioned that a major change should be a major version bump, not a minor one.

@ildar170975
Copy link
Contributor

Probably because it not a "major change".

@brinkgit
Copy link

brinkgit commented Jan 8, 2024

@brinkgit It does work: image If you do not have it working - this could be a bug (which you need to prove as a bug) or a wrong use. Suggest to ask similar questions in the dedicated HA community thread, you will definitely attract more people.

Finaly I found a solution.
I run HA on a VM machine on windows. I connect to it on firefox, running on a mac.
After restart the mac, clearing cache on the mac, deleting cookies on the mac the miracle happens: it works. Done nothing to the windows machine or the VM.
Anyway: no idea how it happend, but I am happy.

@brinkgit
Copy link

brinkgit commented Jan 8, 2024

I'm surprised that nobody has mentioned that a major change should be a major version bump, not a minor one.

I am not sure that 3.4.1 was the one who gave the trouble, I did not intall 3.4.0. Could have been a problem also in 3.4.0, and that seems to me a more major change

@thomasloven
Copy link
Owner Author

I'm surprised that nobody has mentioned that a major change should be a major version bump, not a minor one.

The change was in a major version bump.
https://github.com/thomasloven/lovelace-card-mod/releases/tag/3.0.0

@KTibow
Copy link
Contributor

KTibow commented Jan 8, 2024

That's fair going by my original comment, but that's not what I meant. Breaking changes should be signified by major versions, to make it more clear that there was a major change to both users and bots.

@thomasloven
Copy link
Owner Author

Yes. I admit I should have communicated this more clearly.
But after the two years, I honestly forgot about it and didn't even remember that there was anything to communicate...

Sorry.

@KTibow
Copy link
Contributor

KTibow commented Jan 9, 2024

I guess that's fair, given that this isn't that big of a problem considering that I don't think HACS or any auto-updaters look at the major version. It's just a mismatch between the semantic versioning spec.

@lollo78
Copy link

lollo78 commented Jan 29, 2024

Just installed 3.4.2 version and my badge didn' t change colors.
What i wrong?
- badges: - entity: sensor.broadlink_temperature name: Temperatura Casa style: | :host { --label-badge-red: {% if is_state('sensor.broadlink_temperature',)|int <= 20 %} green {% elif states('sensor.broadlink_temperature')|int <= 30 %} orange {% else %} red {% endif %}; --ha-label-badge-font-size: 12px; --ha-label-badge-size: 48px; } - entity: device_tracker.iliadbox_r1 name: Router Iliad style: | :host { --label-badge-red: {% if is_state('device_tracker.iliadbox_r1', 'home') %} green {% else %} red {% endif %}; }

@pcb1962
Copy link

pcb1962 commented Jan 29, 2024

The answer is here: https://github.com/thomasloven/lovelace-card-mod/releases

tmack8001 added a commit to tmack8001/ha-rivian-card that referenced this issue Feb 7, 2024
tmack8001 added a commit to tmack8001/ha-rivian-card that referenced this issue Feb 7, 2024
riskitforabiscuit1252 added a commit to riskitforabiscuit1252/YouTube that referenced this issue Mar 26, 2024
Card-mod version 3.4 depreciated an old way to add CSS styles. Having card_mod: above style is now mandatory so this fixes that. More info here on that update here: thomasloven/lovelace-card-mod#332
Sian-Lee-SA pushed a commit to Sian-Lee-SA/YouTube that referenced this issue Mar 26, 2024
Card-mod version 3.4 depreciated an old way to add CSS styles. Having card_mod: above style is now mandatory so this fixes that. More info here on that update here: thomasloven/lovelace-card-mod#332
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

No branches or pull requests

10 participants