I’m trying to place a 2-button row under a 380px-wide status block. With unequal columns (e.g., 280px and 100px) using custom:layout-card, the left edge of the row shifts inward compared to the status block above. With equal columns the alignment is fine. This happens both with Tile and with Mushroom template cards.
The goal is simple: 380px container, same 4px L/R padding as the status block, and a 2-column row (wide “Start” + narrow “Off”) that aligns exactly left with the status block.
Minimal Reproducible Examples
type: custom:mod-card
style: |
:host { display:block; width:380px; margin:0; }
card:
type: custom:layout-card
layout_type: grid
layout:
grid-template-columns: 280px 100px
grid-gap: 0
card_mod:
style: |
/* match status block’s horizontal padding */
ha-card { background:none; box-shadow:none; border:none; padding:0 4px !important; margin:0 !important; }
.card-content, #root { padding:0 !important; margin:0 !important; }
cards:
- type: tile
entity: switch.tapw_timeprogram_bms_forced_qube2
name: Tapwater starten
icon: mdi:hot-tub
vertical: false
- type: tile
entity: switch.tapw_timeprogram_bms_forced_qube2
name: Uit
icon: mdi:power
vertical: false
What I tried (all still show the indent with 280/100)
- Wrapping with one or two
mod-cardlayers to match the status block’s exact padding (4px L/R). - Zeroing out internal paddings/margins via
card_modonha-card,.card-content, and#root. - Forcing
place-items,justify-content,align-contentonlayout. - Putting status block and button row in a single
stack-in-cardto avoid cross-card chrome—indent remains with unequal columns. - Switching card types (Tile ↔ Mushroom): same alignment issue when columns are unequal.
Questions
- Is this expected interaction between
layout-cardand the inner cards when column widths are unequal? - Is there a recommended pattern to get pixel-perfect left alignment under a fixed-width block (380px with 4px L/R padding) while using 280/100 columns?
- If this is a bug, should I open it in Core Frontend (for Tile/Mushroom rendering) or in the
layout-cardrepo (grid wrapper), or both?
Extra context
- A plain button-card row with fixed widths aligns fine; the misalignment only appears with Tile/Mushroom in
layout-cardwhen the columns are unequal. - I can provide before/after screenshots (status block above; two-column row below) that clearly show the left indent.
Thanks for any guidance or workarounds!
