-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for card_margin in grid layouts #195
base: master
Are you sure you want to change the base?
Conversation
Has this been merged yet? This fix is sorely needed. |
This code looks good :) Need this as well ;) *NVM noticed a bug |
I corrected and tested this change in this PR instead https://github.com/thomasloven/lovelace-layout-card/pull/210/files :) |
When I tested this PR, my margins were not appropriately applied. So instead, I mirrored the existing column logic of
I supported this strategy in the same way in my PR https://github.com/thomasloven/lovelace-layout-card/pull/210/files#diff-4f9f8ab90608430f9ad38a4a682f3e9f7cbd2aa69d11a636ec18b84ea33f5094R62, and it works as expected without breaking existing logic, with or without setting card_margin. |
Me too ! |
@thomasloven can we have this merged please? |
Isn't this the same with additional |
@cdhgee With your version of
Did I misunderstand this feature, or how to apply? I just copied |
The intention was to fix the hardcoded card margins that are present in the grid layout. I'll have a play around using your layout config and see if I can figure out what's going on. I was using a custom:layout-card inside a panel layout instead of using the custom:grid-layout directly, maybe it behaves differently for some reason.
…On Sun, Feb 26, 2023, 08:28 Johan Vromans ***@***.***> wrote:
@cdhgee <https://github.com/cdhgee> With your version of card-layout.js I
still get unwanted margins.
views:
- type: custom:grid-layout
layout:
grid-template-columns: 50% 50%
margin: 0
padding: 0
card_margin: 0 0 0 0
cards:
- type: markdown
content: 'a'
- type: markdown
content: 'b'
- type: markdown
content: 'c'
- type: markdown
content: 'd'
Did I misunderstand this feature?
[image: scrot20230226152721]
<https://user-images.githubusercontent.com/1118804/221416646-a3796889-246e-4341-ba0a-4982f3263bf0.png>
—
Reply to this email directly, view it on GitHub
<#195 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJSWKKYNNDNPDCQR4AL523WZNSCFANCNFSM5TBIZ6AA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@sciurius This is how it looks with your code on my system: I've noticed that Lovelace generates/uses gzipped versions of JS files in some instances. I suspect that even though you copied over the card-layout.js file, Lovelace is using the card-layout.js.gz compressed version. Renaming or removing the compressed version and restarting HA should force it to start using the updated card-layout.js file. |
I did replace For the sake of completeness, |
@sciurius Glad you got it working. The difference in size in my local copy vs the PR copy of layout-card.js is because I tweaked the console output of my local copy so that I could be certain that my updated copy was being used. |
Fixes #194