• This repository has been archived on 26/Nov/2021
  • Stars
    star
    660
  • Rank 68,297 (Top 2 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 12 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple responsive CSS grid.

🚨 ⚠️ Attention ⚠️ 🚨

2017 Update: This grid system was created almost 5 years ago now, and should be considered deprecated as these days browsers let you do much more with grids using things like Flexbox. Unless you’re looking for something really basic, you’ll probably be better off using Flexbox to achieve what you need instead. An excellent guide to getting started with Flexbox can be found here: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Gridism

A simple responsive CSS grid. View the demo →

Why?

My process

When I design web layouts, my thought process usually goes something like this:

Alright, in this section, I want a bit that’s one third of the section’s width, and then next to that I want another bit that’s two thirds of the sections’s width. Now, in the next section…

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.

Existing grid frameworks

Most frameworks I’ve used don’t match that thought process at all. I usually have to:

  1. Remember how many columns are in the grid for the particular framework I’m using.
  2. Decide how I want to divide up this particular section’s content.
  3. 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.
  4. Remember the class naming structure for the framework I’m using. Is it .span3, .grid_3, .col-3, or something else altogether?
  5. 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.

Only the second step should be necessary.

Gridism’s Goals

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:

  • Class names should be memorable and self-evident.
  • Gutters and basic content padding should be taken care of.
  • Clearing floats should be done automatically.
  • Wrapped grid sections should be independant of vertical page sections.
  • Frequently required utility classes should be provided.
  • Common patterns for Responsive Design™ should be built-in.

I hope you find that this project is living up to those goals. If not, please create an issue and let me know.

Installation

1. Get the files

The easiest way to use Gridism in your project is via the Bower package manager.

bower install gridism

Elsewise, download the zip folder, extract it, and copy gridism.css into your project’s folder. Boom. Done.

2. Link the stylesheet

Add the following stylesheet to your HTML’s <head> section:

<link rel="stylesheet" href="bower_components/gridism/gridism.css">

Note: If you didn’t install using Bower, you need to adjust the path of CSS file to match your file structure.

3. Viewport scale

Add the following meta tag to your HTML’s <head> section:

<meta name="viewport" content="width=device-width,initial-scale=1">

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.

Contributing

I’d ❤️ to receive 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! 😀.

License

Go nuts. See LICENSE (MIT).

More Repositories

1

ghost-on-heroku

One-button Heroku deploy for the Ghost blogging platform.
JavaScript
743
star
2

dciy

Do Continuous Integration Yourself — a simple, open source CI server.
Ruby
98
star
3

Filefile

A file to keep track of all the files you have in your repo that end in "file".
76
star
4

shapeshifter

An always-on, in-browser, responsive design testing environment.
CSS
52
star
5

octocatsay

You know cowsay, right? Well...
Shell
43
star
6

ubersicht-memory-bar

A small memory bar widget for übersicht →
CoffeeScript
37
star
7

edimax-br-6528n

Mirror of the downloadable firmware for the Edimax BR-6528N Nano wireless router (as at Feb 6th, 2013—v1.10?)
C
29
star
8

dotfiles

Use at your own peril.
Shell
24
star
9

ubersicht-github

DEPRECATED: GitHub contributions graph widget for Übersicht
CoffeeScript
21
star
10

ricochet

Going beyond just dotfiles, but with Ansible. o_O
Shell
15
star
11

redmine-heroku

One-button Heroku deploy for Redmine.
Ruby
14
star
12

hubot-heroku-slack

Deploy a Hubot with Slack adapter to Heroku
CoffeeScript
12
star
13

archived-cobyism.github.io

My website in The Cloud™ ☁️
HTML
10
star
14

sink

Auto-sync file in GitHub repositories
Ruby
9
star
15

hubot-heroku-irc

Deploy a Hubot with IRC adapter to Heroku
CoffeeScript
7
star
16

jquery-caret

Set and query caret position within textareas and text inputs.
JavaScript
6
star
17

alfred-atom

An Alfred workflow to open files and folders using Atom.
6
star
18

joke

[WORK IN PROGRESS—THIS DOESN’T WORK YET] Joke lets you manage Jekyll sites locally like a CMS.
Ruby
6
star
19

jekyll-demo

Demo Jekyll site from Belfast Ruby #12 :)
CSS
3
star
20

litcss

Literate CSS should be a thing.
1
star
21

book-list

Stuff and things
1
star
22

one-non-dualistic-very-bored-cypherpunk-ape-chimp-hybrid-source-of-mind-selfhood-and-oracle-of-truth

WIP
1
star
23

dciy-sandbox

A sandbox which will (one day) safely run a DCIY server.
1
star
24

norniron-slack-hubot

Hubot instance for norniron.slack.com
CoffeeScript
1
star
25

SARMS

A web-based Student At-Risk Monitoring System for managing students, faculty, subjects, assessments, and attendance at educational institutions.
Ruby
1
star
26

strider-on-heroku

One-button Heroku deploy for the Strider CD / CI server
CSS
1
star
27

ignition-ui

Three… two… one…
CSS
1
star
28

dokku-data-volumes

Extraction of https://github.com/dokku-alt/dokku-alt/tree/master/plugins/data-volumes so it can be used without dokku-alt.
Shell
1
star