Improve CSS for entity rows (#1491)

This commit is contained in:
c727 2018-07-21 03:10:42 +02:00 committed by GitHub
parent 5d7e4322eb
commit 6b1d04584e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 8 deletions

View File

@ -28,6 +28,10 @@ class HuiEntitiesCard extends EventsMixin(PolymerElement) {
#states > div { #states > div {
margin: 4px 0; margin: 4px 0;
} }
#states > div > * {
display: block;
overflow: hidden;
}
.header { .header {
@apply --paper-font-headline; @apply --paper-font-headline;
/* overwriting line-height +8 because entity-toggle can be 40px height, /* overwriting line-height +8 because entity-toggle can be 40px height,

View File

@ -6,24 +6,30 @@ import '../../../components/ha-relative-time.js';
import computeStateName from '../../../common/entity/compute_state_name.js'; import computeStateName from '../../../common/entity/compute_state_name.js';
import EventsMixin from '../../../mixins/events-mixin.js'; class HuiGenericEntityRow extends PolymerElement {
/*
* @appliesMixin EventsMixin
*/
class HuiGenericEntityRow extends EventsMixin(PolymerElement) {
static get template() { static get template() {
return html` return html`
<style> <style>
:host { :host {
display: flex; display: flex;
align-items: center;
} }
.flex { .flex {
margin-left: 16px;
flex: 1; flex: 1;
overflow: hidden;
margin-left: 16px;
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
align-items: center;
}
.info,
.info > * {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.flex ::slotted(*) {
margin-left: 8px;
} }
.secondary, .secondary,
ha-relative-time { ha-relative-time {

View File

@ -13,6 +13,11 @@ import LocalizeMixin from '../../../mixins/localize-mixin.js';
class HuiTextEntityRow extends LocalizeMixin(PolymerElement) { class HuiTextEntityRow extends LocalizeMixin(PolymerElement) {
static get template() { static get template() {
return html` return html`
<style>
div {
text-align: right;
}
</style>
<hui-generic-entity-row <hui-generic-entity-row
hass="[[hass]]" hass="[[hass]]"
config="[[_config]]" config="[[_config]]"