fix chart card initial size

This commit is contained in:
f43nd1r 2019-12-07 01:35:56 +01:00
parent ea2ff64358
commit 5dc8b19912

View file

@ -26,27 +26,34 @@ class AcrariumCard extends PolymerElement {
padding: 1rem;
box-sizing: border-box;
display: inline-block;
width: 100%;
height: 100%;
}
.acrarium-card-content-wrapper {
width: 100%;
flex: 1;
min-height: 0;
}
.acrarium-card-content.collapse {
.collapse {
display: none;
}
slot[class~="divider"]::slotted(:not(:first-child)) {
.divider > ::slotted(:not(:first-child)) {
border-top: 1px solid var(--lumo-contrast-20pct);
margin-top: 0.5em;
}
</style>
<slot name="header" class="acrarium-card-header" on-click="handleClick"></slot>
<slot class$="{{getContentClass(collapse, divider)}}"></slot>
<div class$="{{getContentClass(collapse, divider)}}">
<slot class="acrarium-card-content"></slot>
</div>
`
}
getContentClass(collapse, divider) {
let classes = "acrarium-card-content";
let classes = "acrarium-card-content-wrapper";
if (collapse) classes += " collapse";
if (divider) classes += " divider";
return classes;