Here's the standard 12 column grid. On tablet and mobile device resolutions, the columns collapse to span the full width of the page.
.column-6
.column-6
.column-4
.column-4
.column-4
.column-3
.column-3
.column-3
.column-3
.column-2
.column-2
.column-2
.column-2
.column-2
.column-2
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-1
.column-11
.column-2
.column-10
.column-3
.column-9
.column-4
.column-8
.column-5
.column-7
.column-6
.column-6
.column-7
.column-5
.column-8
.column-4
.column-9
.column-3
.column-10
.column-2
.column-11
.column-1
The standard 12 column grid can easily adapt to simplified layouts for tablet and mobile devices.
.column-6.tablet-column-3.mobile-column-2
.column-6.tablet-column-3.mobile-column-2
.column-4.tablet-column-2
.column-4.tablet-column-2
.column-4.tablet-column-2
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-3.mobile-column-1
On tablet device resolutions, you get 6 columns to play with. By default, tablet columns collapse to the full width of the page on mobile resolutions.
.column-6.tablet-column-3
.column-6.tablet-column-3
.column-4.tablet-column-2
.column-4.tablet-column-2
.column-4.tablet-column-2
.column-2.tablet-column-1
.column-2.tablet-column-1
.column-2.tablet-column-1
.column-2.tablet-column-1
.column-2.tablet-column-1
.column-2.tablet-column-1
.column-3.tablet-column-2
.column-9.tablet-column-4
.column-9.tablet-column-4
.column-3.tablet-column-2
For mobile device resolutions the 6 column grid becomes a 4 column grid.
.column-6.mobile-column-2
.column-6.mobile-column-2
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-3.mobile-column-1
.column-9.mobile-column-3
.column-9.mobile-column-3
.column-3.mobile-column-1
Shelves is the only fluid grid where the nested columns line up the grid, no matter how deep you go.
Now, you might think Shelves generates widths for every possible combination of columns within columns within columns within columns...Nope. The secret (yes, we're giving it away) is generating the nested columns widths a single time, but applying them backwards:
.column-11 [class*="column-"] { margin-left: 2.06186%; }
.column-11 .column-1 { width: 7.21649%; }
.column-11 .column-2 { width: 16.49485%; }
.column-11 .column-3 { width: 25.7732%; }
/* etc... */
.column-10 [class*="column-"] { margin-left: 2.27273%; }
.column-10 .column-1 { width: 7.95455%; }
.column-10 .column-2 { width: 18.18182%; }
.column-10 .column-3 { width: 28.40909%; }
/* etc... */
Yeah, this still creates about 50+ lines of CSS. If that bothers you, you can use the Sass mixins to apply nested column widths on only the columns you're using. Or if you think nested columns that align to the grid is a ridiculous, unatainable ideal, you can always generate the grid without nested columns:
$ shelves --skip-nested
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-4
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-4
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-4
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
.column-6
.column-3
.column-2
.column-1
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-6
.column-3
.column-2
.column-1
.column-1
.column-1
.column-3
.column-2
.column-1
.column-1
.column-1
.column-2
.column-1
.column-1
.column-10
.column-2
.column-1
.column-1
.column-8
.column-2
.column-1
.column-1
.column-6
.column-2
.column-1
.column-1
.column-4
.column-2
.column-1
.column-1
.column-2
.column-1
.column-1
You can easily shift columns over the left or right to create additional space between columns.
.column-11.prefix-1
.column-1
.column-10.prefix-1
.column-10.prefix-2
.column-1
.column-9.prefix-2
.column-9.prefix-3
.column-1
.column-8.prefix-3
.column-8.prefix-4
.column-1
.column-7.prefix-4
.column-7.prefix-5
.column-1
.column-6.prefix-5
.column-6.prefix-6
.column-1
.column-5.prefix-6
.column-5.prefix-7
.column-1
.column-4.prefix-7
.column-4.prefix-8
.column-1
.column-3.prefix-8
.column-3.prefix-9
.column-1
.column-2.prefix-9
.column-2.prefix-10
.column-1
.column-1.prefix-10
.column-1.prefix-11
.column-10.prefix-2
.column-8.prefix-2
.column-6.prefix-2
.column-4.prefix-2
.column-2.prefix-2
.column-1
.column-10.prefix-1
.column-1
.column-8.prefix-1
.column-1
.column-6.prefix-1
.column-1
.column-4.prefix-1
.column-1
.column-2.prefix-1
With column reordering you can control the order of your columns for SEO or mobile layouts, without sacrificing the visual layout you want on desktop resolutions.
.column-3.push-9
.column-9.pull-3
.column-4.push-8
.column-8.pull-4
.column-5.push-7
.column-7.pull-5
.column-6.push-6
.column-6.pull-6