Skip to content

Commit

Permalink
Fix mediaqueries at page load
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Mar 16, 2021
1 parent 06830c4 commit 85c7afe
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions layout-card.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "layout-card",
"version": "2.1.1b0",
"version": "2.1.1",
"description": "",
"private": true,
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/layouts/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class GridLayout extends BaseLayout {
mq.addEventListener("change", () => this._setGridStyles());
}
}
this._setGridStyles();
}

async updated(changedProperties) {
Expand Down
7 changes: 7 additions & 0 deletions test/lovelace/grid-view.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ layout:
"header header header header"
"main main . sidebar"
"footer footer footer footer"
mediaquery:
"(max-width: 800px)":
grid-template-columns: 50% 50%
grid-template-areas: |
"header sidebar"
"main main"
"footer footer"
cards:
- type: entities
entities:
Expand Down

0 comments on commit 85c7afe

Please sign in to comment.