Hello, how can I change valuecolor in semantic model?
for example first item. I tried to add metadata, but it not work…
If you are asking how to change how that first Item appears in the automatically created UI widgets, you can do so by editing the Custom List Widget on the Item.
I have the same question. In BasicUI there was the parameter valuecolor that you could use to e.g. display sub-zero temperatures in blue and above zero in red.
I would love the same for the label - list view so that I can visually spot e.g. if there are any windows open.
No, like I said, the default list widget.
sorry) I’ve seen list widget, it’s no colors or styles…
In these cases - it’s a little more complicated - what you want to do is override the following property from: CSS Variables Reference | Framework7 Documentation
--f7-list-item-after-text-color
from the default gray to the result of an expression. You can override other variables too as you see fit.
You can only do it in YAML. So in your metadata editor for the “Default List Item Widget”.
- @11148 in the Code view set it to something like:
value: " "
config:
style:
--f7-list-item-after-text-color: "=(Number.parseFloat(items.ZW074Sensor_Temperature.state.split(' ')[0]) < 20) ? 'blue' : 'red'"
--f7-list-item-after-font-weight: bold
(replace ZW074Sensor_Temperature
with your item, unfortunately you can’t get it from the config currently )
Go back to the Config tab to see how it looks:
- @s0170071 assuming the “real” states of your items are OPEN and CLOSED:
value: " "
config:
style:
--f7-list-item-after-text-color: "=items.EG_WC_Fenster.state === 'OPEN' ? 'red' : 'green'"
--f7-list-item-after-font-weight: "=items.EG_WC_Fenster.state === 'OPEN' ? 'bold' : 'normal'"
thank you it works
Very nice, but unfortunately not working for me. No matter what state of the item, the color is always green and the font weight is always normal. Can you tell me where i’am wrong, please?
value: " "
config:
style:
--f7-list-item-after-text-color: "=items.InnogyHeizungFitnessraum_NiedrigerBatteriestatus.state === 'ON' ? 'red' : 'green'"
--f7-list-item-after-font-weight: "=items.InnogyHeizungFitnessraum_NiedrigerBatteriestatus === 'ON' ? 'bold' : 'normal'"
i dont see a problem… may be browser cache? or item state? may be state of item “on” not “ON”?
and You dont have indent after config: