mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 20:06:33 +00:00
Fix name styling (#1522)
* Fix name styling * Update hui-glance-card.js * Demo * Update demo-hui-glance-card.js * Update hui-glance-card.js
This commit is contained in:
parent
36ba37c59c
commit
e458cf1388
@ -127,6 +127,20 @@ const CONFIGS = [
|
||||
- light.kitchen_lights
|
||||
`
|
||||
},
|
||||
{
|
||||
heading: 'Selectively hidden name',
|
||||
config: `
|
||||
- type: glance
|
||||
entities:
|
||||
- device_tracker.demo_paulus
|
||||
- entity: media_player.living_room
|
||||
name:
|
||||
- sun.sun
|
||||
- entity: cover.kitchen_window
|
||||
name:
|
||||
- light.kitchen_lights
|
||||
`
|
||||
},
|
||||
];
|
||||
|
||||
class DemoPicEntity extends PolymerElement {
|
||||
|
@ -54,6 +54,9 @@ class HuiGlanceCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.name {
|
||||
min-height: var(--paper-font-body1_-_line-height, 20px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<ha-card header$="[[_config.title]]">
|
||||
@ -62,7 +65,7 @@ class HuiGlanceCard extends LocalizeMixin(EventsMixin(PolymerElement)) {
|
||||
<template is="dom-if" if="[[_showEntity(item, hass.states)]]">
|
||||
<div class="entity" on-click="_handleClick">
|
||||
<template is="dom-if" if="[[_showInfo(_config.show_name)]]">
|
||||
<div>[[_computeName(item, hass.states)]]</div>
|
||||
<div class="name">[[_computeName(item, hass.states)]]</div>
|
||||
</template>
|
||||
<template is="dom-if" if="[[!item.icon]]">
|
||||
<state-badge state-obj="[[_computeStateObj(item, hass.states)]]"></state-badge>
|
||||
|
Loading…
x
Reference in New Issue
Block a user