CZonin
August 12, 2023, 5:44pm
1461
I was able to move the tabs to the bottom of my screen and center them horizontally using a combination of Navbar Position and the following in my theme:
card-mod-theme: Mushroom Shadow
card-mod-root-yaml: |
ha-tabs$: |
#tabsContainer {
display: flex;
justify-content: center;
}
Can’t figure out how to increase the height of the tabs though. If I try
card-mod-root-yaml: |
ha-tabs$: |
#tabsContainer {
display: flex;
justify-content: center;
height: 110%
}
It seems something is happening but the active tab indicator gets hidden, but the height of the tabs doesn’t change. Any ideas?
Hiding a “search” button
There were some solutions to achieve this, but seems that some of them (at lest what I have seen) are not working.
Here is a way for 2023.8.
It supports mobile clients which may have a “Search” menu item.
card-mod-root-yaml: |
.: |
.header .toolbar .action-items:not(:has(ha-icon-button[slot="actionItems"])):not(:has(.exit-edit-mode)) ha-button-menu mwc-list-item:nth-of-type(1) {
display: none;
}
.header .toolbar .action-items > ha-icon-button[slot="actionItems"]:nth-child(1) {
display: none;
}
BTW, a “search” button is still available in “Settings”…(and no way to hide it by card-mod-theme)
1 Like
And this is how to hide all buttons & menu (if anyone really needs this):
card-mod-root-yaml: |
.: |
.header .toolbar .action-items {
display: none;
}
Hi IIdar, how can i change the “flex: 0 1 0%;” in below “div id” i want “flex: 1 1 0%;”
I tried with flex-grow 1; , but it still dont bite
I currently have this in my theme:
card-mod-root-yaml: |
.: |
.toolbar {
background-color: transparent !important;
}
.toolbar div.main-title {
display: flex;
flex-grow: 0;
}
card-mod-sidebar-yaml: |
.: |
a:hover paper-icon-item ha-icon {
color: #87bf50 !important;
}
a:hover paper-icon-item .item-text{
#87bf50;
}
a:hover paper-icon-item {
background: #7b7d80;
}
EDIT: i “temporary” fixed it in the header-card.js
bangali
August 26, 2023, 12:13am
1465
how do I flash the border of a button card on click?
thank you.
"Sidebar" view: allow to scroll “main” area w/o scrolling a sidebar
Currently in a “Sidebar view” the whole page is scrolling down if needed.
This mod allows to scroll the “main area” independently of a “sidebar area”.
Available only if the “main area” is NOT in one column with the “sidebar area”.
This is mainly useful for tablets (ofc for desktops as well).
Tested on 1920x1200 desktop, iPad Air 2, iPhone 5S (real devices).
Here captured gifs (emulator in Chrome):
card-mod-view-yaml: |
hui-sidebar-view:
$: |
.container div#main {
max-height: calc(100vh - var(--header-height) - 4px);
overflow-y: auto;
}
@media (max-width: 760px) {
.container div#main {
max-height: unset;
overflow-y: unset;
}
}
PR was proposed as well:
home-assistant:dev
← ildar170975:sidebar-view-scrolbar
opened 12:19AM - 04 Sep 23 UTC
Currently in a "Sidebar view" the whole page is scrolling down if needed.
This … PR allows to scroll the "main area" independently of a "sidebar area".
Available only if the "main area" is NOT in one column with the "sidebar area".
This is mainly useful for tablets (ofc for desktops as well).
Tested on 1920x1200 desktop, iPad Air 2, iPhone 5S (real devices, not emulators).
![side1](https://github.com/home-assistant/frontend/assets/71872483/d7691a07-2071-4901-8688-de54748a1fc5)
![side2](https://github.com/home-assistant/frontend/assets/71872483/489fc8c5-8500-4a76-b11a-7afcc291b6e8)
<!--
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue or discussion
in the additional information section.
-->
## Type of change
<!--
What type of change does your PR introduce to the Home Assistant frontend?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x ] New feature (thank you!)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Example configuration
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR.
-->
```yaml
```
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue or discussion:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x ] The code change is tested and works locally.
- [x ] There is no commented out code in this PR.
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
<!--
Thank you for contributing <3
-->
[docs-repository]: https://github.com/home-assistant/home-assistant.io
3 Likes
afxefx
(Jerry Sullivan)
September 5, 2023, 1:43pm
1467
Thank you for this Ildar! I’ve been trying to hide the Assist button for some time now and had given up until I saw your post. This worked perfect for hiding the Assist button as well.
hiding those menu items is super robust nowadays with the Kiosk-mode custom card. In fact, Ive removed all hide_xxx from my themes and have Kiosk mode take care of it.
its options are hugely expanded, and there is but 1 item it cant hide yet, (and I wont tell because you might not even be bothered by it )
anyways, install Kiosk mode and make the card_mod_themes more robust, but not having to take care of it anymore.
Its very actively developed currently so cant underdress its usefulness
WarC0zes
(WarC0zes)
September 8, 2023, 5:45am
1469
Hello,
with the new energy panel color option. I realized that it is only the bars that change color, but not the sources.
I modified my theme to use card_mod and modify the source colors.
mushroom_noborder:
ha-card-border-width: 0
energy-grid-consumption-color-0: red
energy-grid-consumption-color-1: green
card-mod-theme: mushroom_noborder
card-mod-card: |
ha-card > div > div > table > tbody > tr:nth-child(1) >
td.mdc-data-table__cell.cell-bullet > div {
background: red !important;
}
ha-card > div > div > table > tbody > tr:nth-child(2) >
td.mdc-data-table__cell.cell-bullet > div {
background: green !important;
}
modes:
light: {}
dark: {}
1 Like
matata
(Martin Prochazka)
September 18, 2023, 5:19pm
1470
Hello… please…
This code work for me in card yaml
But, in theme not workig.
…
What is wrong please?
matata
(Martin Prochazka)
September 18, 2023, 5:30pm
1472
If I try *-yaml … styles not write in
because “ha-card.xxxxx xxxx $:” is a wrong syntax.
matata
(Martin Prochazka)
September 18, 2023, 8:32pm
1474
Thank you so much…
Only round-slider$ on start works great… but how i select only thermostat card?
Cannot say for sure, not using this card(((
davidnestico
(David Nestico)
September 29, 2023, 3:20am
1476
Trying to do this now, this goes in the theme file right? Also how do I select the tab I want the icon on specifically? Thanks.
Addressed by a tab’s label:
aria-label='badge_in_tab'
Yes.
See more detailed examples here or in Github how card-mod is used in themes.
1 Like
Does card_mod not affect iframe?
Trying to remove the header but it’s not working.
type: custom:mod-card
card_mod:
style: |
.mdc-top-app-bar {
display: none !important;
}
card:
type: iframe
url: >-
/media-browser/browser/app%2Cmedia-source%3A%2F%2Fnest/
aspect_ratio: 150%
If you are asking about modding iframe card - then you are asking in a wrong thread.
Go to card-mod thread.
But I guess this about modding a subview’s header, right?
Then why the iframe here in your code?
Did latest update (2023.10.0) “messed up” card-mod-root-yaml … again ? , or is it just my installation ?
Fixed by renaming card-mod-root-yaml TO card-mod-root
and card-mod-sidebar-yaml TO card-mod-sidebar
mhhh, weird
And now i see core-2023.10.1 released … guess it should be “safe” , in this matter