Skip to content

Instantly share code, notes, and snippets.

@OfTheDelmer
Created October 16, 2013 20:37
Show Gist options
  • Save OfTheDelmer/7014417 to your computer and use it in GitHub Desktop.
Save OfTheDelmer/7014417 to your computer and use it in GitHub Desktop.

Intro To Bootstrap

Style and UX

OBJECTIVE
To become familiar with the conceptual elements (grid, navs, navbar, ...) of Bootstrap, and use those tools to design a responsive page layout.

Outline:

  • layouts:
    • The Responsive Grid
    • How it's different v2 vs. v3
    • Mobile First UX design
  • Containers and Rows,
    • 12 column grid
    • media types
    • mixing media types to get dynamic features
    • offsets margins
  • Elements
    • header for navbar, navs
    • jumbotron
    • buttons
    • media-lists
    • dropdowns/dropups, labels
  • Forms
    • input groups

What is Bootstrap

Released in 2011,

  • Meant to encourage standards, consistency, low-maintenance

What are some different options over Bootstrap,

Foundation, Semantic UI

The Layout choices

layout example

terms def
row
12 Divisibility
elastic

One the most important components in the layout beyond the base container is the row. Each row has a 12 column divisibility.

Note how twelve can be easily divied into 1/2's, 1/3's, and 1/4's.

What's the point? In Bootstrap v2, this grid was elastic, and would have stylistic breaks when something shrunk smaller than a tablet.

Bootstrap v3 does away with this spotty grid in favor of mobile first UX design.

You design at the mobile level first and then design toward tablets and desktops.

Bootstrap's competitors already supported this, which prompted their switch.

To help handle the different media devices there are four column size class variations.

type pixel size
col-xs-* Phones (<768px)
col-sm-* Tablets (≥768px)
col-md-* Desktops (≥992px)
col-lg-* Desktops (≥1200px)

If you use the .col-xs-* class that style will be maintained for all media types larger than 768px, BECAUSE OF MOBILE FIRST DESIGN.


practice 1

Bootstrap also lets you concatenate these different media groups on a single element, which creates a more dynamic control of the design.

In Your Rails App

Add this to your Gemfile

group :assets do 
….
	 gem 'bootstrap-sass-rails'
end

In your application.js add (after jQuery)

//= require twitter/bootstrap

In your application.css.scss put after your requires

@import "twitter/bootstrap";

Why @import vs //= require

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment