#Add ha-card element to all the cards
1 messages · Page 1 of 1 (latest)
I'm not quite following what you're asking for. Are you asking about how to use card_mod with a custom card? You still have to edit the card's YAML via Show Code Editor and add your card_mod.
For example:```yaml
type: custom:mushroom-chips-card
chips:
- type: entity
entity: person.derek
use_entity_picture: true
card_mod:
style: |
ha-card {
border: none;
--chip-box-shadow: none;
--chip-background: none;
--chip-font-size: 24px;
--chip-padding: 0 0.3em;
--text-color: red;
--chip-height: 75px;
--chip-border-radius: 45px;
}
not really. some custom cards are not wrapped in a ha-card element, which makes them have a different style of the wrapper. I was wondering if anyone know a custom card that will force other custom cards to be wrapped in a ha-card element
or maybe I just don't understand how the ha-card element works
That, ultimately, is going to come down to the custom card's developer and how they designed the card. You can still use card-mod on non ha-card elements and shadow root sections.
This is an example were I was accessing different portions of a slider. (Sharing as a image and not text because this code is broken and no longer works.)
yeah, I've been doing this, but it just becomes hard to maintain. I guess it's better to just use as much default ha-cards I can
True. But not everything is accessible in the ha-card element. Generally, the basic stuff is there but when you want to drill into the design a bit more, that's when you have to be a bit more creative.
This is another example that I was playing with. ```yaml
type: custom:mushroom-media-player-card
entity: media_player.living_room_6
card_mod:
style:
mushroom-shape-icon$: |
.shape {
--shape-color: rgba(0,200,0,0.2) !important;
}
.: |
ha-card {
--card-primary-color: green;
--card-secondary-color: green;
background: rgba(0,200,0,0.1);
}
ha-state-icon {
color: green
}
here for instance the cards that are wrapped in that ha-card have that nice wrapper with shadow around. if they are not wrapped they don't have which makes them have different paddings, etc
What card in particular do you mean?
the titles and the half width cards
Are you using the Sections view? There's a lot that is still work-in-progress with that view.
yes, but I doubt it has something to to with it. if I put that title card on a grid view will look the same
Are you using Mushroom cards?
yes, but they look fine
Okay. I don't know what card you're using to show the titles. That's why I keep trying to figure out what specific card you're using.
see, here the muchroom cards are nicely wrapped in that light gray wrapper. but not the title. what it would be nice is to have control over wrapper. for instance if used alone a mushroom card would look like it does now. if wrapped in a grid or stack card, wrap all those cards in that container
it's bubble card, but again this is the case with other cards as well.
From the card_mod docs:
NOTE: card-mod only works on cards that contain a ha-card element. This includes almost every card which can be seen, but not e.g. conditional, entity_filter, vertical-stack, horizontal-stack, grid.
Note, though that those cards often include other cards, which card-mod can work on.
See the manual for each card to see how to specify parameters for the included card(s).