$ npm install bluegrid
@import node_modules/bluegrid/bluegrid
<link rel="stylesheet" type="text/css" href="node_modules/bluegrid/dist/bluegrid.min.css">
$ bower install bluegrid
@import bower_components/bluegrid/bluegrid
<link rel="stylesheet" type="text/css" href="bower_components/bluegrid/dist/bluegrid.min.css">
$ meteor add colbycheeze:bluegrid
$ meteor add fourseven:scss
@import {colbycheeze:bluegrid}/bluegrid
Bluegrid's API is powerful, while meeting your preferred way of speaking to become simple, clean, and intuitive.
.layout-wrapper
.layout-wrapper { @include row(); }
.content { @include column(8); }
.sidebar { @include column(4); }
.three-col { @include column(3); }
.perc-25 { @include column(25%); }
.one-of-4 { @include column(1 of 4); }
.one-4 { @include column(1 4); }
.default { @include column(); }
.fit { @include column(fit); }
.grow { @include column(grow); }
.fixed-col { @include column(300px); }
.wrapper-left
.wrapper-center
.wrapper-right
.wrapper-around
.wrapper-between
.tall-wrapper-top
.tall-wrapper-middle
.tall-wrapper-bottom
.wrapper-left { @include row(left); } // can be written as row();
.wrapper-center { @include row(center); }
.wrapper-right { @include row(right); }
.wrapper-around { @include row(around); }
.wrapper-between { @include row(between); }
.tall-wrapper-top { @include row(top center); height: 125px; } // can be written as row(center);
.tall-wrapper-middle { @include row(center middle); height: 125px; }
.tall-wrapper-bottom { @include row(bottom center); height: 125px; }
// ** Rows **
// Justify horizontally
'start': left start beginning justify-start,
'center': center hcenter justify-center,
'end': right end justify-end,
'around': around justify-around,
'between': between justify-between,
// Align vertically
'top': top align-start content-top,
'middle': middle vcenter align-center,
'bottom': bottom align-end content-bottom,
// ** Columns **
'fit': fit match content 'match content',
'grow': grow stretch expand
.wrapper-left
.wrapper-right
.offset-1 {
@include column(2);
@include offset(1);
}
.offset-1-right {
@include column(2);
@include offset(1, right);
}
.wrapper-left
@import 'vendors/breakpoint/breakpoint';
@import 'vendors/bluegrid/bluegrid';
.example-responsive-col {
@include column();
@include breakpoint(600px) {
@include column(50%);
}
}
.item-variable {
@include column(fit);
order: -1;
@include breakpoint(600px) { order: 1; }
@include breakpoint(800px) { order: 2; }
@include breakpoint(900px) { order: 3; }
@include breakpoint(1000px) { order: 4; }
}
.item-one { @include column(grow); order: 0; }
.item-two { @include column(grow); order: 1; }
.item-three { @include column(grow); order: 2; }
.item-four { @include column(grow); order: 3; }
Classes are included for rapidly prototyping and/or debugging layouts. This isn't the "semantic" way of building production websites, but it certainly helps to have them available.
Compiling of classes can be switched off in settings to save file size.
// _variables.scss
...
$bluegrid-settings: (
'do-compile-classes': true,
...
);
.col grow
.col fit grow-s
.col fit grow-m
.col fit grow-l
.col fit
.col
.col x5
.col x4
.col x3
.col s6
.col s6
.col m4
.col m4
.col m4
.col l3
.col l3
.col l3
.col l3
<div class="container">
<div class="row">
<div class="col"> Full Width column </div>
<div class="col x6">6 columns on all screen sizes</div>
<div class="col s6">6 columns on small and up</div>
<div class="col m6">6 columns on medium and up</div>
<div class="col l6">6 columns on large and up</div>
<div class="col fit">Column will shrink to size of content</div>
</div>
</div>
.col x4 offset-1
.col x4 offset-1
.col x6
.col x3 offset-m6
.col x3 offset-l7
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.col x2
.row top
.col x6 l4
.row middle
.col x6 l4
.row bottom
.col x6 l4
Col 1
Col 2
Col 3
Col 4
Col 5
Col 6
1
2
3
4 .first
1 .last
2
3
4
Whoa.
That's Deep!
Hello!
.col m4
I am an element that lives outside of the grid.
.col x4
.col x4
.col x4
// _variables.scss
// Add, remove, or rename breakpoints here
$bluegrid-breakpoints: (
'x': default,
's': 600px,
'm': 960px,
'l': 1140px
);
$bluegrid-settings: (
// Default grid variables
'num-cols': 12,
'gutter-width': 1rem,
'default-span': 100%, //This can be 'fit', or a unit (1), or fill whole row (100%)
// Defaults for content containers
'container-width': 1280px,
'container-padding': 1rem,
...
// Mixin terminology omitted ...
);