SlideShare una empresa de Scribd logo
1 de 64
Descargar para leer sin conexión
Making Peace with
        Twitter Bootstrap
                                 Melanie Archer
                            HTML5 Developer Conference
                                San Francisco, CA
                                   April 2013
Wednesday, March 27, 2013                                1
Who’s talking?

                             Web developer
                             @mejarc
                             http://twobanjos.com

Wednesday, March 27, 2013                           2
Who’s talking?

                              Slide URL:
                     http://slidesha.re/Wuboo4



Wednesday, March 27, 2013                        3
Why bother?


                                                 You will have
                                               to deal with it

                            Photo: Bundesarchiv, B 145 Bild-F024624-0004 / Gräfingholt, Detlef / CC-BY-SA, via Wikimedia Commons
Wednesday, March 27, 2013                                                                                                         4
Problems

                            Bootstrap Bloat




Wednesday, March 27, 2013                     5
Problems

                            Bootstrap Bloat
                            Bootstrap’s Class-itis



Wednesday, March 27, 2013                            6
Problems
                            Bootstrap Bloat
                            Bootstrap’s Class-itis
                            Bootstrap: inflexible


Wednesday, March 27, 2013                            7
PROBLEM


Wednesday, March 27, 2013             8
Bootstrap Bloat




                              Photo: http://www.flickr.com/photos/wanderlost63

Wednesday, March 27, 2013                                                       9
Bootstrap Bloat

                               The problem might
                            not be with Bootstrap


Wednesday, March 27, 2013                           10
Fix


Wednesday, March 27, 2013         11
Strategies

                             Customize download
                             Customize @import



Wednesday, March 27, 2013                         12
Downloading

                               The least, first




Wednesday, March 27, 2013                        13
git clone
      https://github.com/
      twitter/bootstrap.git



Wednesday, March 27, 2013     14
Using LESS

                              Delete unwanted
                            @import



Wednesday, March 27, 2013                       15
cp bootstrap.less my-bootstrap.less




Wednesday, March 27, 2013         16
gem ‘twitter-bootstrap-rails’




Wednesday, March 27, 2013                       17
gem ‘therubyracer’
       gem ‘less-rails’
       gem ‘twitter-bootstrap-rails’




Wednesday, March 27, 2013              18
Using            bower    or   npm


                            More LESS




Wednesday, March 27, 2013                          19
bower install bootstrap




Wednesday, March 27, 2013           20
cp components/bootstrap/bootstrap.less ...




Wednesday, March 27, 2013                            21
npm install twitter-bootstrap-node




Wednesday, March 27, 2013              22
cp vendor/bootstrap/less/bootstrap.less ...




Wednesday, March 27, 2013                           23
Using SASS

                              Delete unwanted
                            @import



Wednesday, March 27, 2013                       24
gem 'bootstrap-sass'




Wednesday, March 27, 2013         25
$ cd `bundle show bootstrap-sass`
$ cd vendor/assets/stylesheets
$ cp bootstrap.scss ...
$ cp bootstrap/bootstrap.scss ...




Wednesday, March 27, 2013           26
git clone
   https://github.com/jlong/sass-
   twitter-bootstrap.git




Wednesday, March 27, 2013           27
yo webapp


Wednesday, March 27, 2013               28
Would you like to include
   Twitter Bootstrap for
   Sass? (Y/n) Y



Wednesday, March 27, 2013      29
Using Initializr




Wednesday, March 27, 2013                      30
<link href=”[CDN]/bootstrap.css” />




Wednesday, March 27, 2013         31
<link href=”[CDN]/bootstrap.css” />




Wednesday, March 27, 2013         32
Treating Bootstrap Bloat

                              Use Bootstrap in LESS/
                            SASS components

                              Copy bootstrap.*

                              Revise your copy
Wednesday, March 27, 2013                              33
PROBLEM


Wednesday, March 27, 2013             34
Bootstrap’s Class-itis




                            Photo: http://www.flickr.com/photos/dukeyearlook

Wednesday, March 27, 2013                                                 35
What you want




Wednesday, March 27, 2013                   36
! ! <div class="page">
! ! ! <header class="global">
! ! ! ! <h1>My Semantic Markup Fantasy
        </h1>
! ! ! </header>
! ! ! <nav class="global">
! ! ! ! <ul>
! ! ! ! ! <li class="active">
! ! ! ! ! ! <a href="#article1">
! ! ! ! ! ! ! Article 1


Wednesday, March 27, 2013            37
What you use




Wednesday, March 27, 2013                  38
! ! <div class="container">
! ! ! <div class="row">
! ! ! ! <div class="span8 page-header"
id="header">
! ! ! ! ! ! <h1>
        My Presentational Markup Reality
            </h1>
! ! ! ! </div>
! ! ! </div>
! ! ! <div class="row">
! ! ! ! <div class="span12" id="nav">
! ! ! ! ! <ul class="span8 nav nav-pills">
! ! ! ! ! ! <li class="active">
! ! ! ! ! ! ! <a href="#article1">
! ! ! ! ! ! ! ! Article 1

Wednesday, March 27, 2013                    39
Fix


Wednesday, March 27, 2013         40
What you want




Wednesday, March 27, 2013                   41
! ! <div class="page">
! ! ! <header class="global">
! ! ! ! <h1>My Semantic Markup Fantasy
      </h1>
! ! ! </header>
! ! ! <nav class="global">
! ! ! ! <ul>
! ! ! ! ! <li class="active">
! ! ! ! ! ! <a href="#article1">
! ! ! ! ! ! ! Article 1


Wednesday, March 27, 2013            42
@import "mixins.less";




Wednesday, March 27, 2013    43
Treating Bootstrap’s Class-itis

                              @import Bootstrap’s
                            mixins or style rules
                              Use these rules for your
                            own selectors

Wednesday, March 27, 2013                                44
PROBLEM


Wednesday, March 27, 2013             45
Bootstrap: inflexible?




                            Photo: http://www.flickr.com/photos/walkingsf

Wednesday, March 27, 2013                                              46
The Plan




                               Photo: http://www.flickr.com/photos/telstar

Wednesday, March 27, 2013                                                   47
The Result




                              Photo: http://www.flickr.com/photos/caseorganic

Wednesday, March 27, 2013                                                      48
!important


Wednesday, March 27, 2013                49
.alt {
   margin: 10px 5px;
 }

 .alt.exception {
   margin-top: 18px;
 }

 .alt.exception.just-this-one-time {
   margin-top: 0;
 }




Wednesday, March 27, 2013              50
Fix


Wednesday, March 27, 2013         51
New process


                             No more PSDs



Wednesday, March 27, 2013                   52
Wednesday, March 27, 2013   53
//
  // Variables
  // --------------------------------------------------


  // Global values
  // --------------------------------------------------


  // Grays
  // -------------------------
  @black:                 #000;
  @grayDarker:            #222;
  @grayDark:              #333;
  @gray:                  #555;




Wednesday, March 27, 2013                                 54
builtwithbootstrap.com
              expo.getbootstrap.com




Wednesday, March 27, 2013             55
Make peace

                              Take only what you
                            need



Wednesday, March 27, 2013                          56
Make peace

                             Use your class names




Wednesday, March 27, 2013                           57
Make peace

                              Design with Bootstrap,
                            not against it



Wednesday, March 27, 2013                              58
☮
Wednesday, March 27, 2013       59
Thanks

                            Bill Fisher
                            Dave Nugent
                            Michael Knowles
                            Angel Inokon
Wednesday, March 27, 2013                     60
Questions


Wednesday, March 27, 2013               61
More
     BVision, “Please stop embedding Bootstrap classes in your
     HTML”
     http://ruby.bvision.com/blog/please-stop-embedding-
     bootstrap-classes-in-your-html

     Roberto Soares, “Integrating Twitter Bootstrap with Ruby
     on Rails”
     http://blog.robertosoares.me/blog/2012/08/17/
     integrating-twitter-bootstrap-with-ruby-on-rails/


Wednesday, March 27, 2013                                        62
More

    Mario Noble, “Getting started with SCSS and Bootstrap”
    http://www.slideshare.net/marionoble/getting-started-
    with-scss-and-bootstrap

    Sean Brewer, “How-To: Awesome Web Design with Twitter
    Bootstrap”
    http://saidigital.co/customize-twitter-bootstrap-4216/




Wednesday, March 27, 2013                                    63
More
        Ash Tewari, “Bootstrap With LESS”
        http://blog.appliedis.com/2013/02/04/bootstrap-with-
        less/

        Pat Shaughnessy, “Twitter Bootstrap, Less, and Sass:
        Understanding Your Options for Rails 3.1”
        http://rubysource.com/twitter-bootstrap-less-and-sass-
        understanding-your-options-for-rails-3-1




Wednesday, March 27, 2013                                        64

Más contenido relacionado

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Destacado

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Making Peace with Twitter Bootstrap