No need to have 100500 different cards.
Try to unify all you views, then select patterns which can cover all your use-cases - and for these patterns create decluttering cards with all needed mods. Means - edit a code in 1 place ā get results in many.
Very same about automations (blueprints).
Edit: at some point people create configs simpler because some mods/features are not really needed IRL.
ofc I have considered those decluttering templates, and use them where I can. itās a nice tool I use throughout the config
However, many of these fold-entity-rows in my config have extra mods, for top margin, for scrolling etc etc.
Also, they dont all list the same items. Those items need their own mods, like when listing entities, or maps, or graphsā¦ all need specific additional mods.
so no way of creating a generic decluttering I am afraid.
unless we could āmergeā the mods, like we can do in button-cardā¦ maybe I should revisit that once and see what gives.
I have several decluttering folds, which are used when eg listing identical sensors, in this case my doors:
Yes, I also find that everytime I use card_mod on a card it is slightly different. So I never started using the decluttering card. It would probably make sense to check it out again but I am finding that IF I need to mod, it is usually because layouts donāt fit. And those are usually a problem specific to the one card I am building.
I.e., each of those (usually grid) cards contains a different combination of cards and I have to mod each one for it to fit properly inside the grid.
What would be cool would be if anchors (I think that is what the style refs are called) were not changed to the referenced code but stayed as anchors on saving. That would save some code. But making a decluttering template for 5 instances is maybe more work than repeating the code via c&p in that one card.
Right now I am thinking of removing my themed padding and reverting to per-card-padding. Maybe that would be a good use case for decluttering. But I am not sure if that will really save me muchā¦
I just checked and I have a total of ā10 cardsā in my main dashboard (each card is usually a templated card or grid with subcards). I try to have as little cards as possible with as much information and features as possible because mobile phones are simply not made for card rich dashboards.
the mods for the fold icon (size and color) dont work, even though setting these on a fold-entity-row card directly do what they should. No effect at all.
the mods in the head do work as expectedā¦
maybe a bug in decluttering-card, maybe a user issue?
for now, it seems I still need to edit the icon size and color inside the resource itself (has the benefit of the auto repositioning using max-width: calc(100% - var(--toggle-icon-width) - 8px);
and I can use the decluttering for the other mods.
Or, try and find how to edit the resource to fix padding and label
Do you need card_mod in there? I thought decluttering-card could modify the icon directly.
decluttering_templates:
my_first_template: # This is the name of a template
default:
- icon: fire
card:
type: custom:button-card
name: '[[name]]'
icon: 'mdi:[[icon]]'
But I am just asking without being too familiar with it. Just what I concluded from the examples in the decluttering-card thread.
I would like to move part of a recurring card mod to a theme but I could not find a matching example here and my conclusion from a different example seems to be false.
What do you mean it is unbalanced?
The screenshot looks like you move the button out of its frame (I am guessing because of your margin -8px).
But I am not sure what else looks unbalanced. It looks like the icon remains where it was but the text looks like it is aligned left rather than center. But hard to tell without seeing the inspector frames.
Maybe a bit more difficult to see, but the text-field is much higher (missing height: 3em !important;) and the text is at the bottom instead of the center (missing align-self: center !important;).
There are some other theme mods in play that already make the icon smaller and remove the fieldās label. But they are in :host.
For me this is what an input_text should look like by default and I have > 10 of them. So I would rather have it in my theme.
But I seem to be getting either the syntax wrong or it needs to be placed differently when added to a theme rather than the card.
EDIT: The --text-field-padding can also be achieved by card-mod-card: | .card-content { padding: 0em 0px 0px 0px; }
That is part of my default theme.
It is really about accessing the mdc-text-field.
I guess these styles for input_text were taken from here:
card-mod thread ā 1st post ā link at the bottom ā styles for input_text (+ how to make ā¦ look less different).
So what is the problem with adding this to a theme?
Just checked - yes, same, a difference is only in a height: 40px vs 3em
But it is not. Neither if I use card-mod-card instead of row.
So I do not know what the problem is other than it not oing anything when I add it to my theme.
Hence I think my conversion from card-mod āyaml in a cardā to the non-yaml in my theme seems wrong.
Would it make life easier to use card-mod-<thing>-yaml? Is that then direct copy&paste from the card?
Because to be honest, I could not find anywhere why there is a yaml and non-yaml version in theming. Bu it seems that originally most examples were the non-yaml.