mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Allow controlling badge margin via mixin (#289)
* Allow controlling badge margin via mixin * Move margin-bottom from ha-label-badge to ha-badges-card
This commit is contained in:
parent
75679e90f2
commit
6a864106e0
@ -4,6 +4,12 @@
|
||||
|
||||
<dom-module id='ha-badges-card'>
|
||||
<template>
|
||||
<style>
|
||||
ha-state-label-badge {
|
||||
display: inline-block;
|
||||
margin-bottom: var(--ha-state-label-badge-margin-bottom, 16px);
|
||||
}
|
||||
</style>
|
||||
<template is='dom-repeat' items='[[states]]'>
|
||||
<ha-state-label-badge hass='[[hass]]' state='[[item]]'></ha-state-label-badge>
|
||||
</template>
|
||||
|
@ -215,7 +215,7 @@
|
||||
// Find column with < 5 entities, else column with lowest count
|
||||
function getIndex(size) {
|
||||
var minIndex = 0;
|
||||
for (i = minIndex; i < entityCount.length; i++) {
|
||||
for (i = 0; i < entityCount.length; i++) {
|
||||
if (entityCount[i] < 5) {
|
||||
minIndex = i;
|
||||
break;
|
||||
@ -229,6 +229,7 @@
|
||||
|
||||
return minIndex;
|
||||
}
|
||||
|
||||
if (showIntroduction) {
|
||||
cards.columns[getIndex(5)].push({
|
||||
hass: hass,
|
||||
@ -262,7 +263,7 @@
|
||||
});
|
||||
|
||||
// Add 1 to the size if we're rendering entities card
|
||||
size += other.length > 1;
|
||||
size += other.length > 0;
|
||||
|
||||
curIndex = getIndex(size);
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.label-badge {
|
||||
position: relative;
|
||||
|
Loading…
x
Reference in New Issue
Block a user