Skip to content

Home Information - Your home, your data, organized.

Python
3.2 KB
Raw Blame
/* Framework fallback panel for ROW and TILE contexts. Renders entity
 * icon + name plus a compact list of the first few states (controllers
 * + sensor values). Self-contained — the collection-card wrapper does
 * not add any chrome of its own.
 */

.hi-state-panel-fallback__icon {
    flex-shrink: 0;
}
.hi-state-panel-fallback__icon svg {
    width: 100%;
    height: 100%;
}
.hi-state-panel-fallback__name {
    font-weight: 600;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Override default ``min-width: auto`` on flex items — without this,
     * ``text-overflow: ellipsis`` never triggers because the flex item
     * refuses to shrink below its content's intrinsic width. Combined
     * with ``max-width: 100%`` (and the parent's own min-width: 0), the
     * name finally respects the grid cell boundary. */
    min-width: 0;
    max-width: 100%;
}

/* Per-state compact block: label above value/control. Both contexts
 * use the same per-state structure; the parent layout differs (the
 * row stacks states horizontally, the tile stacks them vertically).
 */
.state-compact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.state-compact__label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6c757d);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.state-compact__value {
    font-size: 1rem;
    line-height: 1.2;
    overflow: hidden;
}
/* Compact form inside the value cell — strip the controller's default
 * row chrome (history button, oversized text-center label) that lives
 * in controller_data_row.html. The form widget itself stays
 * functional. */
.state-compact__value form {
    margin: 0;
}

/* ROW: icon left, name next, states stacked horizontally on the right. */
.hi-state-panel-fallback--row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    min-height: var(--hi-panel-row-min-height);
}
.hi-state-panel-fallback--row .hi-state-panel-fallback__icon {
    width: 32px;
    height: 32px;
}
.hi-state-panel-fallback--row .hi-state-panel-fallback__name {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 1rem;
}
.hi-state-panel-fallback--row .state-compact {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 280px;
    margin-left: auto;
    align-items: flex-end;
}

/* TILE: icon centered atop name; states stacked vertically below. */
.hi-state-panel-fallback--tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    text-align: center;
    /* Allow this grid-item-as-flex-container to shrink below its
     * content's intrinsic width so name truncation propagates from
     * the cell boundary all the way to ``.hi-state-panel-fallback__name``. */
    min-width: 0;
}
.hi-state-panel-fallback--tile .hi-state-panel-fallback__icon {
    width: 48px;
    height: 48px;
}
.hi-state-panel-fallback--tile .hi-state-panel-fallback__name {
    font-size: 1rem;
    line-height: 1.2;
}
.hi-state-panel-fallback--tile .state-compact {
    align-items: center;
    width: 100%;
}