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