nice!
almost there now:
- type: heading
heading: Speciale scenes
heading_style: title
card_mod:
style: |
ha-card.type-heading {
background: var(--background-color-off);
--ha-heading-card-title-color: var(--text-color-off) !important;
--ha-heading-card-title-font-size: 20px !important;
--ha-heading-card-title-font-weight: 400;
padding: 12px;
}
.content {
justify-self: left !important;
}
is the styling I always use for my header custom buttons,
button_default_title:
# aspect_ratio: 12/1
show_state: false
show_icon: false
tap_action:
action: none
styles:
card:
# - border: none
- background: var(--background-color-off)
- color: var(--text-color-off)
- font-size: 20px #24px
- font-weight: 400 #300
#- letter-spacing: 0px
# - font-weight: bold
- padding: 12px
# - pointer-events: none
name:
- justify-self: left
or type: entities
cards via card-mod theme class:
ha-card.class-header-margin .card-header {
background: var(--background-color-off);
font-weight: 400;
font-size: 20px;
color: var(--text-color-off);
padding: 0px 12px;
margin: 0px 0px 16px 0px;
}
and this is an 98% succes (top is the new section type: heading
, bottom is type: custom:button-card
:
on the theme subject:
I had to take out the card-mod theme variables, because even the !important
did not override that, card-mod-theme is more powerful, or, is applied later, which ever it is.
the margins arenāt an exact copy yet. I suppose I need to touch the .content with justify-self: left
but this doesnt do it. Maybe I can somehow get it in the main ha-card.type-heading
style differently, needs more study
Also now, the 2 entities I do have in there need customizing, as those colors are not inherited by the mod.
If @Ildar_Gabdullin reads this, maybe we need a separate post for the new family of mods? Both as card-mod, and here, as card-mod theming mods?
suppose its good to do so soon, because otherwise the posts will get scattered
update
adding height, and a bit more detailed padding does the job for now (for the bar and title, not yet for the embedded entities).
- type: heading
heading: Speciale Scenes
heading_style: title
card_mod:
style: |
ha-card.type-heading {
background: var(--background-color-off);
--ha-heading-card-title-color: var(--text-color-off) !important;
--ha-heading-card-title-font-size: 20px !important;
--ha-heading-card-title-font-weight: 400;
height: 50px;
padding: 12px 0 12px 8px;
}
So next up is getting this into a class, and set it to the headings that dont need entities):
ha-card.class-section-heading .container {
background: var(--background-color-off);
--ha-heading-card-title-color: var(--text-color-off) !important;
--ha-heading-card-title-font-size: 20px !important;
--ha-heading-card-title-font-weight: 400;
height: 50px;
padding: 12px 0 12px 8px;
}
which again is close, but not yet thereā¦ huh, why dont the height and padding get applied? am I targeting the wrong element?:
- type: heading
heading: Speciale Scenes
heading_style: title
card_mod:
class: class-section-heading
# style: |
# ha-card.type-heading {
# background: var(--background-color-off);
# --ha-heading-card-title-color: var(--text-color-off) !important;
# --ha-heading-card-title-font-size: 20px !important;
# --ha-heading-card-title-font-weight: 400;
# height: 50px;
# padding: 12px 0 12px 8px;
# }
well, they did get applied, but somehow the calculation is different, because it targets a dfferent element apparently. This works:
ha-card.class-section-heading .container {
background: red;
--ha-heading-card-title-color: var(--text-color-off) !important;
--ha-heading-card-title-font-size: 20px !important;
--ha-heading-card-title-font-weight: 400;
height: 24px;
padding: 12px 8px 12px 12px;
}
and Ive set the background to red in this test to be able to see the right padding, which I also set as an extra guard to fit the embedded entities:
It;s an exact match now, and I hope Ive got the first functional card-mod theming class in my config
now we know how to mod the colors, we can also template themā¦ a whole new world of options lies ahead