Add support for card_margin in grid layouts#195
Add support for card_margin in grid layouts#195cdhgee wants to merge 2 commits intothomasloven:masterfrom
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 in my PR, which already has a fallback defined in its configurationI 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. |
|
whats the problem with adding this option? please merge this. |
|
Hi @atopetiff, we're researchers from Stockholm University studying communication on GitHub. A message you posted may come across as rude, disrespectful, or unreasonable — something that could discourage others from contributing or sharing their ideas:
You can opt out of messages like this here. If you are the moderator of this repository, you can opt out of messages like this for the entire repo here. Note Participate in our four-question survey to provide feedback, and follow us for project updates! This message was flagged by an automated system and reviewed using an AI tool to check for tone and clarity concerns. We’re not here to judge. Our goal is to help make collaboration smoother for everyone. Messages like this can sometimes cause stress or burnout for others involved in the project. Here are a few quick tips to make messages clearer and easier to engage with:
Thanks for contributing to GitHub and helping improve collaboration for everyone! |






Fixes #194