timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

Mushroom Style Changes

Open jhemak opened this issue 1 year ago • 5 comments

Style changes were made in Mushroom between v3.6.4 to v4.0.0. These changes may need to be incorporated into timer-bar-card as the height of cards no longer matches Mushroom when using v4.0.0. https://github.com/piitaya/lovelace-mushroom/pull/1471.

image

Left is a timer-bar-card; right is a mushroom-template-card.

jhemak avatar Aug 01 '24 21:08 jhemak

As a temporary solution, and if you have card-mod installed, you can add this to the end of your timer-bar-card's configuration:

card_mod:
  style: |
    ha-card {
      transition: none !important;
      padding: 0px !important;
    }

So for example:

type: custom:timer-bar-card
entity: timer.example_timer
name: "My Example Timer"
card_mod:
  style: |
    ha-card {
      transition: none !important;
      padding: 0px !important;
    }

EthanBezz avatar Aug 02 '24 04:08 EthanBezz

Thanks @EthanBezz!

jhemak avatar Aug 02 '24 11:08 jhemak

Now that Home Assistant version 2024.8.0 has been released, more card-mod magic is needed in order for the timer-bar-card to match the slimmer look of the other cards.

Replace the old temporary solution with this newer temporary solution:

card_mod:
  style: |
    ha-card {
      transition: none !important;
      padding: 0px !important;
      --spacing: var(--mush-spacing, 10px) !important;
      --icon-size: var(--mush-icon-size, 36px) !important;
    }
    div.bar-container.pointer {
      min-height: 1em !important;
    }

EthanBezz avatar Aug 08 '24 05:08 EthanBezz

Thanks for keeping up with these changes! It seems the mushroom cards are changing a lot as the Home Assistant team finishing up the new sections layout.

I'll wait for them to finish before updating the card to be consistent. Then, I can tackle updating to the latest mushroom and adding whatever sections layout requires in one go.

rianadon avatar Sep 09 '24 05:09 rianadon

Now that Home Assistant version 2024.8.0 has been released, more card-mod magic is needed in order for the timer-bar-card to match the slimmer look of the other cards.

Replace the old temporary solution with this newer temporary solution:

card_mod:
  style: |
    ha-card {
      transition: none !important;
      padding: 0px !important;
      --spacing: var(--mush-spacing, 10px) !important;
      --icon-size: var(--mush-icon-size, 36px) !important;
    }
    div.bar-container.pointer {
      min-height: 1em !important;
    }

Do you know what the css would be to make the state of the timer Screenshot 2024-10-19 at 16 38 47 bold to match the mushroom theme?

tempus2016 avatar Oct 19 '24 15:10 tempus2016

@EthanBezz and @rianadon - looks like the card_mod hack above is no longer working as of 2025.1. The cards are now showing much taller than they should be. Do you know how to fix?

jhemak avatar Jan 07 '25 02:01 jhemak

@jhemak Mine blew up to.

yestrdave avatar Jan 07 '25 15:01 yestrdave

The issue, at least for me, was introduced by version 3.5.0 of card-mod. It appears the release has been pulled and we should return to version 3.4.4. Once I did that, the problem I reported immediately above was resolved.

jhemak avatar Jan 07 '25 22:01 jhemak

Thank you. I got tired of fixing it and deleted css out. Doesn’t look as good but timer works. Hopefully someday this works with mushroom card and the new sections view.

yestrdave avatar Jan 07 '25 22:01 yestrdave

I'm working on a fix for this plus supporting the sections view. Thanks everyone for your patience.

rianadon avatar Jan 12 '25 19:01 rianadon

Fixed in v1.31.0 🎉

rianadon avatar Jan 12 '25 21:01 rianadon

You rock - thank you!

I have only one card-mod left now ... which is the below to accommodate timers of >1 hour. Not sure if you would like to incorproate it as well?

card_mod:
  style: |
    div.text-content.value.pointer {
      width: 4em !important;
    }

jhemak avatar Jan 13 '25 02:01 jhemak

This should be configurable with the text_width option.

rianadon avatar Jan 13 '25 02:01 rianadon

is there anything special I need to do to apply this - mine still padded after updating

image

AJErazzor avatar Jan 13 '25 04:01 AJErazzor

The padding will only disappear in mushroom mode. So add mushroom: to your config and you'll see it. You'll also need to have mushroom cards installed.

Now that mushroom cards and the included tile cards look practically the same, I need to sometime decouple this card from mushroom cards and start calling the mushroom stuff "tile card appearance" or something similar. That'll allow me to make this style the default as well. That's a lot of work, however, so for now I'm reliant on mushroom configuration.

rianadon avatar Jan 13 '25 05:01 rianadon

as soon as I add in mushroom: it borks the layout? I have mushroom installed but not sure what mushroom cards is?

image

AJErazzor avatar Jan 13 '25 05:01 AJErazzor

You have the right thing installed! I meant mushroom not mushroom cards.

I should have better managed the logic for putting the card into mushroom mode though. In your screenshot it's currently in a twilight zone of being sized like a mushroom card but still looking like a normal card.

Change

entities:
  - entity: timer.outdoor_water_valve_timer
    name: Water timer

to

entity: timer.outdoor_water_valve_timer
name: Water timer

and the card should now look like a mushroom card.

To make the card full-width, you can go to the layout tab then check "full width card".

rianadon avatar Jan 15 '25 06:01 rianadon

Thank you that changed fixed it!!!

AJErazzor avatar Jan 15 '25 06:01 AJErazzor