Fluid Grid Systems in Sketch 39
The Sketch Team has been working really hard on Symbols lately. And Sketch 39 (Currently in Beta) has a really awesome new Feature called Group Resizing. This allows you to set sizing constraints on nested elements within a Group or Symbol.
Besides the obvious uses I thought it would be interesting to think outside the box a little, and a create a Fluid Grid
Start by drawing a rectangle 120px wide x 100% the height of your artboard.
I chose 120px because I am using the 1440px x 1024px Desktop HD artboard. 1440/12 = 120. This doesn’t matter too much because the grid is to going to be fluid, but it will make resizing easier later on.
Now create your Gutters, I am adding an 8px wide x 100% high rectangle on each side, which will give me a 16px gutter between the columns.
Now group your elements and get ready for the magic ✨
Select both gutter rectangles and set Resizing to “Pin to Corner”. This will Pin each rectangle to the the nearest corner. So your Left Gutter will stick to the left edge of the group and the Right Gutter will stick to the Right. Your gutter width will remain static as you resize the group.
You can try it out by resizing the Column Group
Now select the Group and create a symbol
Now duplicate your symbol 11 times to create our 12 column grid
Pro Tip: Option Drag to create the first copy, then press ⌘ + D to continue making duplicates.
You can now group all the column symbols and create a 12 Column Grid Symbol.
🎉 We now have a Resizable Fluid Grid in Sketch!
Now you can go crazy and create more grids (8/16/24) with same Column Symbol.
The reason for making the column the same height as the artboard, is because the pinned elements will shrink with the parent, but they will not grow in height.
Our Symbols are perfectly pixel fitted. As we resize the grid to uneven sizes Sketch is going to have to make compromises and place the columns on sub-pixels.
Our options are to not worry about it or only resize the grid in increments equal to the number of columns. So for our 12 column grid, we would only resize the grid in multiples of 12px.
A few tricks to make this easier than dragging
Queue the shameless plug.
Nudg.it is a little app I made to set custom nudge settings in Sketch.
You can set you Big Nudge (Shift + Arrow) to 12px and you can Shape Nudge (Shift + CMD + Arrow) you Grid in 12px increments.
As always let me know what you think. And I encourage everyone to think outside the box with your Design Workflows!
This currently only works in Sketch Beta
Source File- http://www.nudg.it/assets/fluid-grids.sketch