Here’s my recent accomplishment with card_mod. It took me many hours of trying to re-learn the DOM navigation stuff but I persevered and succeeded. The battle was with icons and icon colors in the custom:multiple-entity-row element. The most time consuming for me was changing the icon_color in the secondary entity. The achievement was this layout which also utilizes the declutter-card and the card-mod card, both for my first time:
and have similar code in my Home Assistant startup automation to override the state at startup.
Note: only three blinds are being overridden as the other three are older v2 blinds and I have those templated:
No need to use/define variables on such a deep level of DOM.
Besides, posting long code distracts users from a solution itself.
But I myself really appreciate an intention to share a successful result with people.
I will give your comment a like!
Myself, I hate the lack of detail often prevalent when perusing threads.
As for the deep level of DOM I arrived at, it was after many hours and the turning point was discovering the online card-mod-helper tool plus the need to remove spaces within the selector. I haven’t discovered (yet) how to shorten it… As for the use of variables, my bad! Will attempt to correct…
Ofc, colors of “secondary” icons may be done directly by using a native “styles” option; with card-mod you may make colors templated by jinja.
Also, icon’s color (for the main entity & “secondary” entities) may be also controlled automatically w/o card-mod by theme variables in some cases.
I know grid is less common here and I did not find any fitting examples, so maybe it is not a grid problem.
But I am creating a card with vertical-stack, entities, custom:button-card and markdown.
Vertical-stack
** Custom:Layout-card (type grid)
*** Two custom:button-card in the first grid (i.e. first row of vertical-stack)
*** 5 Entities and 2x5 markdown cards (with custom:config-templater) in the second grid (i.e. second row of vertical-stack)
Unfortunately, there is a gap between the first and second row (two custom:layout-card grids).
In addition, the content of all my markdown cards (populated with custom:config-templater) is aligned top/start instead of center.
Does anybody know where I need to apply my styling to fix these two issues?
Almost. An em is specifically the width of the letter M of the current font at its current size. Similar is ex, which is the height of the letter x. This matters, because a font of size 24pt isn’t just a 2x scaled up version of the 12pt font. In some cases it is, but for well-designed fonts this isn’t the case. So, if you have a UI where different font sizes are used at different screen sizes, using these relative measures scale things in a special non-linear proportion. Otherwise, we could just have stuck to a percentage, but that won’t always look right. Anyway, I thought it would be interesting to know. There was a time I took a lot of interest in typography.
Probably a CSS formatting or syntax issue, right? Have tried seeking help in the CSS documentation, CSS validators and asked ChatGBT, but so far no success? What am I doing wrong?
Assume we have this multi-level structure:
element A → element B → element C → element D
For simplicity - assume that on each level an element has only one child.
Assume we need to apply some property like “color: red”.
We need to go down only to the level (not deeper) where this property is really meaningful (even may be not used yet - but the child element may inherit this property; this is a trick which MAY be useful if the child element is changed in some version of HA).
Means - no need to set the property to the element D if it is sufficient on a level C.
Next, assume this feature (color) may be set by some variable.
I.e. on this level C the color is by default defined as “var(–ha-super-color, #ff00ff)”.
Means - you may set this “–ha-super-color” on the level A - and this will work.
But if there is only ONE level - check a simple example based on your+mine codes: