mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-18 23:06:40 +00:00
Smaller text in label badge if long value
This commit is contained in:
parent
b26ee9b9a6
commit
6aa46e06f3
@ -32,6 +32,9 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.label-badge .value.big {
|
||||
font-size: 70%;
|
||||
}
|
||||
.label-badge .label {
|
||||
position: absolute;
|
||||
bottom: -1em;
|
||||
@ -70,7 +73,7 @@
|
||||
<template>
|
||||
<div class='badge-container'>
|
||||
<div class='label-badge' id='badge'>
|
||||
<div class='value'>
|
||||
<div class$='[[computeClasses(value)]]'>
|
||||
<template is='dom-if' if='[[icon]]'>
|
||||
<iron-icon icon='[[icon]]'></iron-icon>
|
||||
</template>
|
||||
|
@ -25,4 +25,8 @@ export default new Polymer({
|
||||
observe: 'imageChanged',
|
||||
},
|
||||
},
|
||||
|
||||
computeClasses(value) {
|
||||
return value && value.length > 5 ? 'value big' : 'value';
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user