alump / GridStack

Vaadin layout add-on using gridstack.js library
Apache License 2.0
10 stars 7 forks source link

top and bottom paddings for GridStack demo #11

Closed Artgit closed 8 years ago

Artgit commented 8 years ago

Could you please add in your awesome example http://app.siika.fi/GridStackDemo/#!split - top and bottom paddings the same like we have from the left and right ?

alump commented 8 years ago

What padding you mean?

But you should be able to define those in your theme.

Artgit commented 8 years ago

I mean padding at the top and bottom of GridStack, the same as at left and right. Unfortunately I didn't find a way how to do it.

I have attached screenshot for more details: padding

alump commented 8 years ago

One simple way to resolve this would be to add css rule:

.v-splitpanel-second-container {
  padding-top: 6px;
}

You might want to give own stylename to your SplitPanel to avoid this rule applying to all second containers of all SplitPanels.

alump commented 8 years ago

https://github.com/alump/GridStack/commit/32b21632022df7cde14ac3e777209a3ba7c32279

Example

Artgit commented 8 years ago

Thanks for your answer. This solution applied to SplitPanel's container.. but I have here some other components together with GridStack. I have a panel above GridStack so with this solution I have a padding above this panel but not in GridStack component.

alump commented 8 years ago

if you have those components together with eg. verticallayout, just use the setSpacing(true) of it. Or just add padding to slot that contains the gridstack.

Artgit commented 8 years ago

Is it possible to add padding to GridStack container itself ?

alump commented 8 years ago

Looks like gridstack library itself doesn't provide any margin support. So it has to be done with CSS. Adding it to wrapping element is valid way to handle this. I don't think i will add wrapper to my implementation for this requirement. If nothing else you can add CssLayout as wrapper, and set padding there.