Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Twitter Bootstrap

Darby Frey
October 31, 2012

Twitter Bootstrap

Darby Frey

October 31, 2012
Tweet

More Decks by Darby Frey

Other Decks in Technology

Transcript

  1. SMACSS http://smacss.com/ • Opinionated style guide • Aims to create

    a consistent methodology to building with CSS Jonathan Snook Thursday, November 1, 12
  2. INSTALLATION • Download jQuery & Bootstrap http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js http://twitter.github.com/bootstrap/assets/bootstrap.zip • Unzip

    file. Put CSS, Javascripts and Images in the correct folders. • Add <link> and <script> tags to your layout. The Less Easy Way Thursday, November 1, 12
  3. INSTALLATION • twitter-bootstrap-rails gem https://github.com/seyhunak/twitter-bootstrap-rails • In your Gemfile: gem

    “twitter-bootstrap-rails” • Install the required JS & CSS files with: “rails g bootstrap:install” • Generate a layout with: rails g bootstrap:layout LAYOUT_NAME fixed/fluid i.e. “rails g boostrap:layout application fixed” • See Railscasts: http://railscasts.com/episodes/328-twitter-bootstrap-basics http://railscasts.com/episodes/329-more-on-twitter-bootstrap The Easy Way (Rails) Thursday, November 1, 12
  4. GRID : FLUID GRID : FIXED LAYOUT / FLUID LAYOUT

    RESPONSIVE DESIGN : TYPOGRAPHY : CODE VIEW TABLES : FORMS : BUTTONS : ICONS : BUTTON GROUPS : TABS : PILLS : NAV LISTS : NAVBAR BREADCRUMBS : PAGINATION : PAGER : INLINE LABELS BADGES : PAGE HEADER UNIT : HERO UNIT THUMBNAILS : ALERTS : PROGRESS BARS : WELLS CLOSE ICON : MODALS : DROPDOWNS : SCROLLSPY TOGGLABLE TABS : TOOLTIPS : POPOVERS : COLLAPSE CAROUSEL : TYPEAHEAD Thursday, November 1, 12
  5. GRID • 12 column grid • 940px wide fixed layout

    • Responsive • Fixed or Fluid layouts defined with: class=”container” / class=”row” class=”container-fluid” / class=”row-fluid” • Define columns with class=”span*” and class=”offset*” * = your column size Thursday, November 1, 12
  6. NAVBAR • Navbar / Fixed Navbar (top/bottom) • Brand •

    Nav links • Dropdown menus • Embedded Forms Thursday, November 1, 12
  7. BUTTONS • Super easy to make nice looking buttons •

    3 sizes, 7 colors • Can be added to any <a>, <button> or <input> element. • <button class=”btn”>BUTTON</button> • <button class=”btn btn-primary”>BUTTON</button> Thursday, November 1, 12
  8. BUTTONS .btn { padding: 4px 14px; font-size: 14px; color: #333333;

    background-color: #f5f5f5; .... } .btn-primary { color: #ffffff; background-color: #006dcc; .... } .btn-warning { color: #ffffff; background-color: #faa732; .... } .btn-primary { padding: 4px 14px; font-size: 14px; color: #ffffff; background-color: #006dcc; .... } .btn-warning { padding: 4px 14px; font-size: 14px; color: #ffffff; background-color: #faa732; .... } Thursday, November 1, 12
  9. TOOLTIPS & POPOVERS • Tooltips & Popovers provide 2 ways

    of adding contextual information within an interface. • Content included in <a> tag using the title or data attributes. Thursday, November 1, 12
  10. GRID : FLUID GRID : FIXED LAYOUT / FLUID LAYOUT

    RESPONSIVE DESIGN : TYPOGRAPHY : CODE VIEW TABLES : FORMS : BUTTONS : ICONS : BUTTON GROUPS : TABS : PILLS : NAV LISTS : NAVBAR BREADCRUMBS : PAGINATION : PAGER : INLINE LABELS BADGES : PAGE HEADER UNIT : HERO UNIT THUMBNAILS : ALERTS : PROGRESS BARS : WELLS CLOSE ICON : MODALS : DROPDOWNS : SCROLLSPY TOGGLABLE TABS : TOOLTIPS : POPOVERS : COLLAPSE CAROUSEL : TYPEAHEAD Thursday, November 1, 12