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

Make icon sizable in template card #13

Closed
sotima opened this issue Apr 4, 2022 · 9 comments
Closed

Make icon sizable in template card #13

sotima opened this issue Apr 4, 2022 · 9 comments

Comments

@sotima
Copy link

sotima commented Apr 4, 2022

First of all: Thank you for your outstanding work on mushroom-cards.

I would love to use them but encountered a small problem. I would like to be able to enlarge the icon size of (at least) the template card. Right now it seems to be fixed at 20px which for my eyes (I am 60 years young) on my phone is a bit small. I even tried to edit it in the mushroom.js (--mdc-icon-size in .shape ha-icon class) - but I can´t get it to work. So it would be much appreciated if you could make this size adjustable via a themes variable.

Thanks again!

Matthias

@totalitarian
Copy link

I'd love this too

@redphx
Copy link

redphx commented May 12, 2022

@sotima @totalitarian you should be able to change icon size with mushroom 1.8.1.
For example:

Mushroom:
    mush-chip-icon-size: 0.6em
    mush-chip-font-size: 0.4em

    mush-icon-size: 54px
    
    modes:
        light: {}
        dark: {}

@sotima
Copy link
Author

sotima commented May 12, 2022

Will try this as soon as possible! Thanks a lot!

@totalitarian
Copy link

Works as described. Many thanks!

Is it possible to only apply this to certain cards though? I only want to change the icon size for 2 out of 5 cards on a view...

@piitaya
Copy link
Owner

piitaya commented May 12, 2022

There is a PR (work in progress) for that : piitaya/lovelace-mushroom#423

But for now, you can define --icon-size using card_mod :

type: custom:mushroom-entity-card
entity: light.kitchen_light
card_mod:
  style: |
    ha-card {
      --icon-size: 54px;
    }

@totalitarian
Copy link

totalitarian commented May 12, 2022

Superstar! One last question if I may... How to remove the blue circle but keep the icon?
image

@piitaya
Copy link
Owner

piitaya commented May 12, 2022

We can't but you're not the first to ask it. Maybe we can add an icon-shape-opacity variable to allow user to hide the circle by setting icon-shape-opacity: 0 😅

@totalitarian
Copy link

totalitarian commented May 15, 2022

We can't but you're not the first to ask it. Maybe we can add an icon-shape-opacity variable to allow user to hide the circle by setting icon-shape-opacity: 0 😅

That would be great!

@Shannondalebreaux
Copy link

There is a PR (work in progress) for that : piitaya/lovelace-mushroom#423

But for now, you can define --icon-size using card_mod :

type: custom:mushroom-entity-card
entity: light.kitchen_light
card_mod:
  style: |
    ha-card {
      --icon-size: 54px;
    }

I tried this but I get this error.
Screenshot_20230217-104255_Home Assistant

Visual editor is not supported for this configuration:
At path: card_mod -- Expected a value of type never, but received: [object Object]

type: custom:mushroom-entity-card
entity: switch.mae_fan
card_mod:
style: |
ha-card {
--icon-size: 54px;
}

You can still edit your config in YAML.

@piitaya piitaya closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
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

5 participants