thomasloven / lovelace-layout-card

🔹 Get more control over the placement of lovelace cards.
MIT License
1.08k stars 127 forks source link

Custom grid layout not working as expected when using a lot of columns #279

Open henri006 opened 8 months ago

henri006 commented 8 months ago

My Home Assistant version: 2024.2.5 (CORE) 2024.02.1 (SUPERVISOR) 20240207.1 (FRONTEND)

Layout-card version (FROM BROWSER CONSOLE):

What I am doing: I am trying to get the perfect card layout for my tablet, so that i don't have to scroll, and so that everything looks nice. Currently I have 4 rows and 4 columns, but would like to change this to 4 rows and 8 columns, so I can have more granular control over the column widths.

However when i try to add more columns, for some reason my climate grid area goes to the wrong place.

CSS that goes wrong (8 columns, 4 rows): Configuration: mediaquery: "(max-width: 999px)": grid-template-columns: 100% grid-template-areas: | "he" "cl" "tgl_ph" "lbr" "ls_bed" "ls_win" "lbh" "st" "bat" "in" "tgl" "au" "(min-width: 1000px)": align-content: start justify-content: start align-items: start justify-items: start grid-template-columns: repeat(8, 12.5%) grid-template-rows: 70px 30vh 38vh 7vh grid-template-areas: > "he he he he he he he he" "in in lbr lbr lbh lbh tgl tgl" "cl cl ls_bed ls_bed ls_win ls_win au au" "bat bat bat bat bat st st st" "tgl_ph tgl_ph tgl_ph tgl_ph tgl_ph tgl_ph tgl_ph tgl_ph" Card that goes wrong: `type: vertical-stack cards:

image

Current setup (4 columns, 4 rows) for my 1280x800 screen: Home view configuration: mediaquery: "(max-width: 999px)": grid-template-columns: 100% grid-template-areas: | "header" "climate" "toggles_phone" "lightbulbsroom" "ledstripbed" "ledstripwindow" "lightbulbshallway" "states" "battery" "info" "toggles" "automations" "(min-width: 1000px)": align-content: start justify-content: start align-items: start justify-items: start grid-template-columns: 25% 25% 25% 25% grid-template-rows: 70px 30vh 38vh 7vh grid-template-areas: | "header header header header" "info lightbulbsroom lightbulbshallway toggles" "climate ledstripbed ledstripwindow automations" "battery battery battery states" "toggles_phone toggles_phone toggles_phone toggles_phone" Screenshot: image

What I expected to happen: Card goes to its designated grid area, like in this CSS & HTML compiler: image

What happened instead:

Climate grid area fills in the wrong area (see what i am doing for more info)

Minimal steps to reproduce:

Dash layout where it still goes right: ` - theme: Backend-selected title: Home2 type: custom:grid-layout layout: mediaquery: '(max-width: 999px)': grid-template-columns: 100% grid-template-areas: | "he" "cl" "tgl_ph" "lbr" "ls_bed" "ls_win" "lbh" "st" "bat" "in" "tgl" "au" '(min-width: 1000px)': align-content: start justify-content: start align-items: start justify-items: start grid-template-columns: 25% 25% 25% 25% grid-template-rows: 70px 30vh 38vh 7vh grid-template-areas: | "he he he he" "in lbr lbh tgl" "cl ls_bed ls_win au" "bat bat bat st" "tgl_ph tgl_ph tgl_ph tgl_ph" icon: '' badges: [] cards:

dash layout where it goes wrong: `views:



Error messages from the browser console:

Loading module from “redacted/config/www/community/lovelace-card-mod/card-mod.js” was blocked because of a disallowed MIME type (“text/html”).
[0](redacted/dashboard-development/0?kiosk=&auth_callback=1&code=redacted)
Uncaught (in promise) TypeError: error loading dynamically imported module: redacted/config/www/community/lovelace-card-mod/card-mod.js
Loading module from “redacted/browser_mod.js?automatically-added” was blocked because of a disallowed MIME type (“text/plain”).
[0](redactedredacted/dashboard-development/0?kiosk=)
LAYOUT-CARD 2.4.4 IS INSTALLED [layout-card.js:228:115](redacted/hacsfiles/lovelace-layout-card/layout-card.js?hacstag=156434866244)
AUTO-ENTITIES 1.12.1 IS INSTALLED [auto-entities.js:172:7850](redacted/hacsfiles/lovelace-auto-entities/auto-entities.js?hacstag=1677445841121)
Uncaught (in promise) redacted/browser_mod.js?automatically-added [load_resource.ts:13:35](https://raw.githubusercontent.com/home-assistant/frontend/20240207.1/src/common/dom/load_resource.ts)
Unknown property ‘-moz-flex-basis’.  Declaration dropped. [0:14:31](redacted/dashboard-development/0?kiosk=)
Unknown property ‘-moz-osx-font-smoothing’.  Declaration dropped. [0:1:75](redacted/dashboard-development/0?kiosk=&auth_callback=1&code=e02dee2188784e94929407d119c2c222&state=eyJoYXNzVXJsIjoiaHR0cDovLzE5Mi4xNjguMTc4LjExNDo4MTIzIiwiY2xpZW50SWQiOiJodHRwOi8vMTkyLjE2OC4xNzguMTE0OjgxMjMvIn0%3D&storeToken=true)
---

**By putting an X in the boxes ([X]) below, I indicate that I:**

- [x] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
- [x] Have made sure I am using the latest version of the plugin.
- [x] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
- [x] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.