[Feat] Implement grid system for positioning/sizing components
coderofsalvation opened this issue · 7 comments
Hi Alex,
First of all: i like what you did with vuegg.
I was thinking about the responsiveness buttons in the bottomright corner.
Google sites has some kind of grid-system going on.
Have you thought about css3 grids?
Thanks Leon!
Grid and media queries are the next thing I want to implement in vuegg... as soon as I get some spare time (any help is welcome as well).
I have in mind to include grid behaviour as an extra feature, having the option to choose how you want to place/size your elements, although very likely grid may become the standard once in place.
Also I would like to include some functionality for displaying (or not) elements, based on the viewport (hence the media queries).
Off the top of my head, I foresee some refactoring around the editor and preview sections, these will probably need to be wrapped a iframe in order to apply a specific viewport to trigger media queries.
Thanks for pointing this out, Leon. I gave some thought to this feature, but I haven't dived deep into it yet, so my assumptions may be wrong (or even better, there may be a more elegant ways to achieve it). Either way this may open a good opportunity for discussion.
Let me know your thoughts
I could imagine displaying the same mobile/tablet/desktop-previewbuttons in
editor-mode, that would basically represent the media-queries.
I see what you mean (and what your first request was), I didn't got you before.
I think that would be a possible solution, but a temporal one... from the UI perspective I need to find a logical place to locate that viewport-button bar (I think it would interfere with the edition, in terms of visual clarity).
However, I think the problem of detecting the breakpoints/viewports will persist... but as you say, best way to find out is experimenting. Most likely I will implement the grid/viewport functionality and the options to select mobile/table/web at the same time (I feel they need each other)
vue-grid-layout seems interesting too: https://jbaysolutions.github.io/vue-grid-layout/examples/01-basic.html
Yes, I actually looked around different approaches when I was building the base a vuegg, this one was one of them, but I ended up choosing vue-draggable-resizable to start with. I did some bug fixes and added some new features for this library (like element recursion), but eventually my needs where pretty specific and I ended up implementing the move-resize functionality from scratch.
I'm unsure on how easily this behaviour could be integrated with the current code base, is worth looking at the complexity at task. From my point of view, I had in mind a simpler way to implement grid behaviour, by just giving control in the properties (instead of in both, properties and editor). Visually I was thinking something similar to the grid inspector on firefox.
With this approach I'm hoping to ease the complexity on the integration with current functionalities, while keeping it simple for a first attempt on the grid feature.