This is a port of Harry Roberts' csswizardry-grids into Stylus. It has all the functionality of the Sass version, with the following extra features:
use_floats(defaultfalse): However, setting this totrueallows you to usefloat: leftinstead ofdisplay: inline-blockfor the grid's basic scaffolding. This alleviates some of the spacing issues inherent todisplay: inline-block; however, right-, center-, middle- and bottom-aligned grid layouts currently don't work with float mode.- Customization: the grid class selectors are generated by interpolating
a small number of variables. Tweaking class names, e.g. shortening
.gridto.grand.grid__itemto.g, is now very easy to accomplish by editing those variables.
Also, a few formerly missing features have been added back:
use_silent_classes(defaultfalse): This settings allows you to completely eschew grid classes from your markup, and use the grid via@extend. Whentrue, only those classes that you actually@extendin your stylesheets will be generated, shaving a few kilobytes off the size of the compiled CSS.use_markup_fix(defaulttrue): leaves fixing the spacing issues that are inherent todisplay: inline-blockup to you - e.g. by eliminating whitespace from your markup (hence the name), or by settingfont-size: 0on the grid container. When this variable is set tofalse, an empirically determined fix is applied. It gives small negative values to the propertiesletter-spacingandword-spacing, which effectively fixes the spacing issue across browsers. It is, however, not guaranteed to be bulletproof. This setting does nothing ifuse_floatsis true.
Simple, fluid, nestable, flexible, Stylus-based, responsive grid system.
- Fully responsive
- Infinitely nestable
- Endless possible combinations
- Simple to understand, human-friendly classes
- Option to keep classes out of your HTML
- Robust
- Simple
- No
.clearor.lastclasses - It just works
Please see Responsive grid systems; a solution? for a comprehensive overview of the principles of the grid system.
Simply fill in/adjust the relevant variables.
$guttercontrols how much space there is between columns.$lap-startand$desk-starttell csswizardry-grids when to fire particular media queries to service those particular sizes. Note that csswizardry-grids works out the ends of any other breakpoints by using these numbers.
If you are using traditional classes then an example, basic usage might look like this:
<div class="grid">
<div class="grid__item lap-one-half desk-two-thirds">
...
</div>
<div class="grid__item lap-one-half desk-one-third">
...
</div>
</div>
There is a very simple demo which can be found at csswizardry.github.com/csswizardry-grids.