Hi everyone, I have been trying to create a fixed footer card at the bottom of the view, but simple css doesnāt work well.
I have tried this
- type: markdown
content: test
card_mod:
style: |
:host {
position: sticky !important;
bottom: 0 !important;
z-index: 999 !important;
}
The example above gives the desired result when scrolling through pages with a lot of content. The card sticks to the bottom as expected. However, on views with little content, the card will be placed exactly below the last card.
- type: markdown
content: test
card_mod:
style: |
:host {
position: absolute !important; /* or fixed, which gives the same result */
bottom: 0 !important;
z-index: 999 !important;
}
The example above works as intended when there is little content on the screen, the card sits neatly at the bottom of the view. However when there is more content on the view, the card will be pushed down and will only be visible when scrolling down the entire view.
Basically what I want is a fixed footer at the bottom of the view, normally position: fixed
or position: absolute
with bottom: 0
would be sufficient to create such a thing. However with lovelace this doesnāt seem to work at all.
I have tried creating a class within the card-mod global theme, but that seems to give an even weirder effect where the card would not be fixed to the bottom, nor being placed just below the last card but somewhere in between. (not entirely sure on how to use classes, but this is what I have tried)
# Theme File /themes/test.yaml
card-mod-theme: Test
card-mod-card: |
ha-card.myfooter {
border-radius: 0px !important;
position: fixed !important;
height: 55px;
bottom: 0;
}
# Card
- type: markdown
content: My Footer
card_mod:
class: myfooter
The above example will apply the border radius and the height as expected, but fixes the card somewhere in between the bottom and last card as mentioned above. I also tried position: absolute
and sticky
where sticky wouldnāt work at all when used in this way.
I have been trying to create a footer for months now but I just canāt seem to figure it out. Any help here would be highly appreciated.
Also another question: Is it possible to apply card-mod-theme to the default theme? For example I want the HA tabs bar to move to the bottom, but still be able to select colors via the color picker in the profile menu.
My apologies for the long question, this mod is awesome but sometimes a bit complicated for a novice like myself.