I've been using bourbon neat to do a desktop first layout that worked fine.
However, I would like to do a mobile first versions, starting with mobile and working my way up. The default grid is 12 columns and for mobile I usually use a grid of 4. I tried changine my grid to 4 and scaling up to 12 but this didn't work.
Is there a better way to do mobile first other than creating the standard desktop layout, then putting a mobile media query into each CSS selector and starting with the mobile version and building up the way?
You should create new breakpoints with the new-breakpoint mixin from Neat. But instead of using max-width like they do in their examples, you can use min-width.
For example:
In the example .main will have a white background and consist out of 4 columns. When the viewport is at least 760 pixels width, it will get a black background and span 8 columns.
I would scope out Chasers by Kenneth Ormandy. It's a little
omega-reset(xn)
include passing "xn" from the previous media-query'somega(xn)
. He provides plenty of documentation on the github repo and you can easily install it with Bower or NPM.To expand on Jorn's answer... you also need to set the
$grid-columns
variable to the mobile width number, as opposed to the desktop number that it is set as a default. This is what the_grid_settings.scss
file looks like for a project I'm currently working on:You can see I've created a lot of new breakpoints and I'm using 6 cols at mobile width as opposed to 4 in the original Neat settings (necessary for what I have going on in my project). You should tailor these settings to work for your own project. The takeaway though is that I'm overriding the
$grid-columns
variable and then creating my new breakpoints. Also, be sure to import your_grid_setting.scss
BEFORE Neat...