Background spark for UIX Forge. Add backgrounds to your Frontend elements.
Footer mold for UIX Forge. Add footer to Masonry and Panel views, or template hidden for you sections footer.
Icon and picture-element styling updates now throttled at 250ms so chatty states don’t put too much stress on Frontend when using icon and picture-element styling
Dashboard view only updates UIX styling when pertinent properties are updated, rather than hass/states (updates on lovelace, narrow and index).
Each theme variable section is independent yaml (its a string which is then parsed as yaml) so each is contained and there is no global yaml scope to the theme.
You can define theme macros to provide for resusable code that way.
Do you think it would be a good idea to request this as a feature then?
As for the macros, I read on that before but maybe I’m using it wrong or can’t do it the way I’m trying. How would you suggest I use the following in the macros, then input it:
ha-button $: |
:host([appearance~="filled"]) button.button {
background: rgba(from var(--md-sys-color-secondary-container) r g b / 0.5) !important;
color: var(--md-sys-color-on-secondary-container) !important;
backdrop-filter: blur(8px);
}
What I’ve tried adding to the yaml file (suggested my Gemini) was:
No. It would not be accepted as it is not possible to achieve.
Gemini is wrong. In your case the macro needs to render text, then you use as a macro with parens (). Macros can return a non-text variable but you don’t need that. Read up about macros in the docs. Macros can also you be placed in files in custom-templates if you even wish to make this easier.
You could also have multiple macros and use together as well.
I would like to add a background image to one specific view header.
(hui-view-header –> div class container)
Is styling views only possible through themes, or can it also be done directly?
And how could I limit this to the header on this specific view of a specific dashboard?
I tried to apply a class to be able to limit the effect to it like:
uix:
class: name-of-my-class
like it works on sections.
Any ideas how this could be solved in an elegant way?
To get the required theme config boilerplate, I highlighted the div.container in Browser inpsector and used uix_path($0)
uix_path output
📝 Boilerplate Theme YAML
my-awesome-theme:
uix-theme: my-awesome-theme
uix-view-yaml: |
"hui-sections-view $ hui-view-header $": |
div.container {
/* your styles for div */
}
Using that theme you can then set CSS styles for the background container - first generally so you can make sure that is right before applying a template to make it view specific.
Next, you can use a template and panel vars to only show based on your requirements. Below is a template to only show on on specific view of a dashboard.
Notes:
I have left in {# uix.debug #} which can can inpsect the template include active template panel variables Remove for production
I always use the method of a fallback just in case panel is not available in a template. Should never happen but it means no error if it does
UIX Test:
uix-theme: UIX Test
uix-view-yaml: |
"hui-sections-view $ hui-view-header $": |
{# uix.debug #}
{% set fullUrlPath = panel.fullUrlPath if 'fullUrlPath' in panel else '' %}
{% if fullUrlPath == 'dashboard-scratchpad/scratchtable' %}
div.container {
background: red;
border-radius: var(--ha-border-radius-lg);
}
{% endif %}
Option 2: uix-forge with background spark as a heading card
This opens up lots of possilities with the uix-forge background spark. Basically use uix-forge as the heading card. If you need more than one card or need badges, then use a vertical-stack, and for badges then contain them in custom:badge-horizontal-container-card. The background spark has no heading adapter (like it does for ha-card and hui-grid-section) so you will need to style the border of the background and perhaps add some padding the vertical stack to your liking.
Heading card yaml... Edited updating to match doc example
I completely missed that reply, as I've already seen your placeholder and therefore got no notification about new replies.
Currently I'm rebuilding my dashboard and try to get rid of too many custom cards and move back to (mostly) Tile-Card and uix modding.
Went for option 1 of your reply and I'm once again a happy customer.
Have you noticed no icon for the UIX integration?
A few weeks ago, I noticed that the icon is missing from HA Settings/repair notifications.
Darryn answered that it's an HACS issue.
But now I can see the icon is not shown in multiple places. At the same time other custom integrations installed with HACS provide their icons.
Is it really HACS issue, or something that could be verified within UIX?
Yes. Still an issue for HACS to solve. The icons you do see are those that are in the Home Assistant Brands repository before that was closed in preference of integrations proving icons natively. HACS is still using old Frontend code which relies only Brand repository only and does not use the update native Home Assistant.
In summary any integration that has not been able to be added to Brands repository will not be shown in any area where the display is being generated by HACS which includes repairs and update sensors it creates.
Thanks for your reply.
I'm still on a learning curve.
I did use the Dom Helper (uix_path($0) when selecting ha-tile-icon in Elements of the DevTools.
It did provide a CSS Target, but when I used it, the --tile-icon-size statement didn't have any effect.
Anyway, I changed my statements and now it works.
I'm not sure why.
Hmm. As you can see on the screenshot attached to my previous post, the icon is missing on Devices&Services page too. TBH I never seen it in my system. Only on some screenshot
Check if you have the icons in custom_components/uix/brand. If yes, then you not sure - perhaps caching issue . If no icons, then try redownloaing UIX.
Also, your screenshot shows a Configured title - not sure where that is. Can you confirm what settings page that is?