question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow theming of template card icon and shape colour

See original GitHub issue

Is your feature request related to a problem? Please describe. I have Mushroom Entity and Template cards in the same view, and want the icon colours to match and also have different colours in light or dark mode in my theme.

However, the default template icon colour appears to be based on the --primary-text-color

--icon-color: var(--primary-text-color);
--shape-color: rgba(var(--rgb-primary-text-color), 0.05);

while the default icon colour for the entity card is based on --mush-rgb-state-entity

--rgb-state-entity: var(--mush-rgb-state-entity, var(--rgb-blue));
--icon-color: rgb(var(--rgb-state-entity));
--shape-color: rgba(var(--rgb-state-entity), 0.2);

Describe the solution you’d like I’d like a theme variable to define the icon colour for the template and preferably the shape.

Describe alternatives you’ve considered By making mush-rgb-state-entity the same as primary-text-color in my theme, I can get the main icon colours to match, but the shape colours are different due to the different opacity being used.

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sotimacommented, Apr 10, 2022

While you are working at this, would it be possible to also make the size of the icon adjustable via a theme variable? Right now they seem to be fixed at 20 px which is a bit small for my eyes on my phone. 😉

1reaction
chrisb86commented, Mar 20, 2022

Okay, now I see my problem.

This is what my theme looks at the moment. The text looks like I want it but the icon colors don’t match. I would like to have blue-grey and amber as icon colors for entities. Bildschirmfoto 2022-03-20 um 12 09 45

When I change the primary text-color and disabled-text-color for the theme, the icons match but the text has too little contrast. Bildschirmfoto 2022-03-20 um 12 10 12

It would be nice when we had the possibility to style every aspect in a theme.

  • mush-default-icon-color
  • mush-default-shape-color
  • mush-disabled-icon-color
  • mush-disabled-shape-color
  • and so on…

These can default to the primary colors of a theme but can be overloaded when one wants to. So you can set the colors to your like, keep the mushroom style consistent but can define other values for e.g. icons and text.

I don’t know if this is possible with the HA theming engine and I don’t know python or typescript. But I did some web development in the last 25 years and think the seperation of style and content is important to keep a consistent look and keep things manageable.

I like the idea that the cards can be used without any themeing. But I would like to be able to theme them properly to build a lovely dashboard.

Thanks for this great work so far!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set icon color with config-template-card? - Frontend
I'm using the add-on called “config-template-card” that lets you set customizations to things on a card. I'm using it to set custom icons...
Read more >
Apply a professional look to your drawings with themes
You can change colors for all shapes (or certain shapes) at once by applying a theme. Apply a theme. On the Design tab,...
Read more >
Change the Logo and Color Schemes of a Classic Theme
Change the Logo and Color Schemes ; Enable color gradient. Select the check box and specify the start and end colors of the...
Read more >
Theming guide - Material Design
Let's start with a simple application, which displays several cards for different categories. We ultimately want each card to have a color scheme...
Read more >
Adaptive icons - Android Developers
To ensure that your adaptive icon supports different shapes, visual effects, and user theming, the design must meet the following requirements:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found