|
| 1 | +# Gridism |
| 2 | + |
| 3 | +A simple responsive CSS grid. [View the demo →](http://cobyism.com/gridism/) |
| 4 | + |
| 5 | +## Why? |
| 6 | + |
| 7 | +### My process |
| 8 | + |
| 9 | +When I design web layouts, my thought process usually goes something like this: |
| 10 | + |
| 11 | +> Alright, in this section, I want a bit that’s one third of the section’s width, |
| 12 | +> and then next to that I want another bit that’s two thirds of the sections’s width. |
| 13 | +> Now, in the next section… |
| 14 | +
|
| 15 | +I don’t think in 12 or 16 column grids. Instead, my mental model basically just consists of the page being divided up into multiple full-width vertical sections, and each vertical section being divided up into simple fractions of the section width. |
| 16 | + |
| 17 | +### Existing grid frameworks |
| 18 | + |
| 19 | +Most frameworks I’ve used don’t match that thought process *at all*. I usually have to: |
| 20 | + |
| 21 | +1. Remember how many columns are in the grid for the particular framework I’m using. |
| 22 | +1. Decide how I want to divide up this particular section’s content. |
| 23 | +1. Mentally do the conversion from what I want to see (one quarter + three quarters, for example) into the number of columns I need for the grid I’m using. |
| 24 | +1. Remember the class naming structure for the framework I’m using. Is it `.span3`, `.grid_3`, `.col-3`, or something else altogether? |
| 25 | +1. Deal with other hassles like clearing floats, messing with column padding to have the gutters look right, indicating which elements are the first in a row, and so forth. |
| 26 | + |
| 27 | +Only the second step should be necessary. |
| 28 | + |
| 29 | +### Gridism’s Goals |
| 30 | + |
| 31 | +I couldn’t find a framework that matched this mental model of how I work, so I started hacking on Gridism with the following goals: |
| 32 | + |
| 33 | +- Class names should be memorable and self-evident. |
| 34 | +- Gutters and basic content padding should be taken care of. |
| 35 | +- Clearing floats should be done automatically. |
| 36 | +- Wrapped grid sections should be independant of vertical page sections. |
| 37 | +- Frequently required utility classes should be provided. |
| 38 | +- Common patterns for Responsive Design™ should be built-in. |
| 39 | + |
| 40 | +I hope you find that this project is living up to those goals. If not, please [create an issue](https://github.com/cobyism/gridism/issues/new) and let me know. |
| 41 | + |
| 42 | +## Installation |
| 43 | + |
| 44 | +### 1. Get the files |
| 45 | + |
| 46 | +The easiest way to use Gridism in your project is via the [Bower](http://twitter.github.com/bower) package manager. |
| 47 | + |
| 48 | +```sh |
| 49 | +bower install gridism |
| 50 | +``` |
| 51 | + |
| 52 | +Elsewise, [download the zip folder](https://github.com/cobyism/gridism/archive/gh-pages.zip), extract it, and copy `gridism.css` into your project’s folder. Boom. Done. |
| 53 | + |
| 54 | +### 2. Link the stylesheet |
| 55 | + |
| 56 | +Add the following stylesheet to your HTML’s `<head>` section: |
| 57 | + |
| 58 | +```html |
| 59 | +<link rel="stylesheet" href="components/gridism/gridism.css"> |
| 60 | +``` |
| 61 | + |
| 62 | +**Note:** If you didn’t install using Bower, you need to adjust the path of CSS file to match your file structure. |
| 63 | + |
| 64 | +### 3. Viewport scale |
| 65 | + |
| 66 | +Add the following meta tag to your HTML’s `<head>` section: |
| 67 | + |
| 68 | +```html |
| 69 | +<meta name="viewport" content="width=device-width,initial-scale=1"> |
| 70 | +``` |
| 71 | + |
| 72 | +Without this meta tag, mobiles and tablets might load your page as a scaled-down version of the desktop size, instead of resizing the content to match the device’s actual viewport width. |
| 73 | + |
| 74 | +## Contributing |
| 75 | + |
| 76 | +I’d :heart: to recieve contributions to this project. It doesn’t matter if it’s just a typo, or if you’re proposing an overhaul of the entire project—I’ll gladly take a look at your changes. Fork at will! :grinning:. |
| 77 | + |
| 78 | +## License |
| 79 | + |
| 80 | +Go nuts. See [LICENSE](https://github.com/cobyism/gridism/blob/gh-pages/LICENSE) (MIT). |
0 commit comments