The LESS CSS Grid
designshack.co.uk
designshack.co.uk
<div class="column grid_12"><p>12</p></div>
OFFS, people. You've got an excellent CSS preprocessor with mixin capability here, use it. Do something like this: #sidebar {
.column;
.grid_12;
// other styling
}
and then this: <div id="sidebar"><p>twelve</p></div>
It's easy, clean, and doesn't maul your markup.(And if you're rolling your own, you can even be more concise - such as, instead of invoking theWidth() twelve times to build your classes as shown here, make an atGridColumn() function and skip making those classes.)
.column and .grid_12 looks more like classes than CSS properties to me.
If you do it properly and want your .features element to take more space you just go to your CSS and adjust width: accordingly.
If you are using some "grid system", then you go to your markup and change .grid_2 to .grid_4. And when you change markup to change presentation instead of modifying CSS—you are doing something wrong.
I recently stumbled upon a pretty nice CSS "framework" (it's more of a starter template) that doesn't have all the crap most grid-frameworks have. It's ironically called Less Framework 3[1] (has nothing to do with LESS.js or the parent article).
It basically boils down to a base adaptive-layout body width, and some comments that tell you the width you should make an element if you want it to span X columns on X screen/device width and adhere to a grid
It just seems like one more thing to learn, at this point...
I'm also a fan of Notepad++, seems like it would be easy to integrate less.js as a plugin.
If you are not a Ruby guy and want to use LESS without much hassle, try lessphp: https://github.com/leafo/lessphp
(Plug warning - I wrote this.)
i have real difficulty getting them to stick to any kind of structure.
a grid seems very restrictive to me, so assume designers would get pretty shitty.