Capitalize first character of attributes (#7313)

This commit is contained in:
Philip Allgaier 2020-10-12 11:43:46 +02:00 committed by GitHub
parent 44166f76d4
commit 97ca0b818e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,9 @@ class HaAttributes extends LitElement {
).map( ).map(
(attribute) => html` (attribute) => html`
<div class="data-entry"> <div class="data-entry">
<div class="key">${attribute.replace(/_/g, " ")}</div> <div class="key">
${attribute.replace(/_/g, " ").replace("id", "ID")}
</div>
<div class="value"> <div class="value">
${this.formatAttribute(attribute)} ${this.formatAttribute(attribute)}
</div> </div>
@ -62,6 +64,9 @@ class HaAttributes extends LitElement {
max-width: 200px; max-width: 200px;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
.key:first-letter {
text-transform: capitalize;
}
.attribution { .attribution {
color: var(--secondary-text-color); color: var(--secondary-text-color);
text-align: right; text-align: right;