SlideShare une entreprise Scribd logo
1  sur  77
Télécharger pour lire hors ligne
Edge of the Web 2009


            CSS FRAMEWORKS
                make the right choice




Kevin Yank	

                               sitepoint.com
@sentience	

                           @sitepointdotcom
CSS FRAMEWORKS


  “a set of tools, libraries, conventions, and best practices that
attempt to abstract routine tasks into generic modules that can
                              be reused”

           — Jeff Croft, Frameworks for Designers
SlickMap CSS
THREE QUESTIONS


   What do CSS frameworks do?

 How do I choose a CSS framework?

   Are CSS frameworks pure evil
                           evil?
THREE QUESTIONS
CSS RESET



      http://www.flickr.com/photos/redux/3219068532/
CSS RESET
CSS RESET
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,
textarea,p,blockquote,th,td {
!    margin:0;
!    padding:0;
}
table {
!    border-collapse:collapse;
!    border-spacing:0;
}
fieldset,img {
!    border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
!    font-style:normal;
!    font-weight:normal;
}
ol,ul {
!    list-style:none;
}
caption,th {
!    text-align:left;
}

                                         * {
h1,h2,h3,h4,h5,h6 {
                                                     ;
                                               rgin:0 ;
!    font-size:100%;
!    font-weight:normal;
                                            ma        0
                                               dding:
}
q:before,q:after {
!    content:'';
                                            pa
}
abbr,acronym {
                                          }
!    border:0;
}
CSS RESET

     YUI Reset CSS                      Eric Meyer’s Reset CSS


leaves critical styles alone              resets critical styles
       ins   left underlined             no :focus outline, unstyled ins




 sets default font styles            attempts to inherit font styles
  strong   not bold, em not italic      leaves built-in font styles
CSS RESET

     YUI Reset CSS                      Eric Meyer’s Reset CSS


leaves critical styles alone              resets critical styles
       ins   left underlined             no :focus outline, unstyled ins




 sets default font styles            attempts to inherit font styles
  strong   not bold, em not italic      leaves built-in font styles
CSS RESET
CONTROVERSY IN
  MICROCOSM
CONTROVERSY IN
              MICROCOSM

  “The problem I’vetake style effectsresets is is that then find me
     “I“The problem I’ve had with thesefor granted. […] It makes
        don’t want to had with these resets that I I then find
 myself think just that littlemore thanever needed to just toof get
    myself declaring much bit than I Iaboutneeded to just toget
         declaring much more harder ever the semantics my
 browsers back to tothe resetthings theI way I want.strongturns
     document. With renderingin place, don’t Ipick As ititturns
     browsers back rendering things the way want. As because
out,the I’m perfectly for boldfacing. Instead, I pickelements render
   out, design calls happy with how number ofof the right element—
     I’m perfectly happy with how a a number elements render
 by default. I like strongto have or b or andor whatever—and then
      by default.it’slike lists have bullets and strong elements to
       whether I lists to or em bullets h3 strong elements to
                              have bolded text.” ” ”
                                have boldedneeded.
                                 style it as text.

            — — Jonathan Snook, No CSS Reset
              Jonathan Meyer, Reset Reasoning
                — Eric Snook, No CSS Reset
CONTROVERSY IN
              MICROCOSM

  “The problemto take style effects for granted. […]then find meme
   “I don’t want I’vetake style effectsresets is that […]makes
     “I don’t want to had with these for granted. I It It makes
 myself thinkjust that little bit harder Iabout needed to justof my my
        think just that little bit than ever the semantics toof
         declaring much more harder about the semantics get
 browsers back to renderingin in place,don’t pick strongitbecause
   document. With the reset things theI way I want.strong because
     document. With the reset place, I don’t pick As turns
out,thedesign callshappyboldfacing. Instead, I pickelements render
  the design calls for with how a number of the right element—
     I’m perfectly for boldfacing. Instead, I pick the right element—
 by whether Iit’s strong oror em or oror h3strong elementsthen
      default. like stronghave or b b h3 or or whatever—and then
       whether it’s lists to em bullets and whatever—and to
                           have bolded text.” ” ”
                              style it asas needed.
                                style it needed.

                — Eric Meyer, Reset Reasoning
             — Jonathan Meyer, Reset Reasoning
                 — Eric Snook, No CSS Reset
CONTROVERSY IN
  MICROCOSM
CSS RESET
http://www.flickr.com/photos/evaekeblad/468013086/




            TYPOGRAPHIC GRIDS
http://www.flickr.com/photos/evaekeblad/468013086/




                       COLUMN GRIDS
COLUMN GRIDS

      Blueprint         960 Grid System      YUI Grids CSS

                                                 fluid or
    950px fixed            960px fixed
                                           750/950/974px fixed

    24 columns           12/16 columns
                                                custom
    or custom              or custom

good docs, nice code,      nice code,        fluid and mixed
  any source order      any source order         layouts
BLUEPRINT

 30px   10px




               950px
BLUEPRINT
  30px   10px




                950px




class="container"
BLUEPRINT
   30px   10px




                 950px


site header class="span-24"




class="container"
BLUEPRINT
       30px   10px




                     950px


    site header class="span-24"




content class="span-18"
    class="container"
BLUEPRINT
       30px   10px




                     950px


    site header class="span-24"



                                    sidebar
content class="span-18"           class="span-6
    class="container"                 last"
BLUEPRINT
                 30px   10px




                               950px


             site header class="span-24"
 feature A
class="span-9"



                                             sidebar
                                           class="span-6
           class="container"                   last"
       content class="span-18"
BLUEPRINT
                 30px   10px




                               950px


             site header class="span-24"
 feature A                     feature B
class="span-9"            class="span-9 last"



                                                  sidebar
                                                class="span-6
           class="container"                        last"
       content class="span-18"
BLUEPRINT
                 30px   10px




                               950px


             site header class="span-24"
 feature A                     feature B
class="span-9"            class="span-9 last"



                                                  sidebar
           body content
            class="container"                   class="span-6
         class="span-18 last"                       last"
       content class="span-18"
BLUEPRINT
                       30px   10px




                                     950px


                  site header class="span-24"
      feature A                      feature B
   class="span-9"               class="span-9 last"



                                                                     sidebar
                  body content
                   class="container"                               class="span-6
                class="span-18 last"                                   last"
              content class="span-18"
department A      department B               department C
 class="span-6"     class="span-6"           class="span-6 last"
960 GRID SYSTEM

  60px   20px   40px




                       960px
960 GRID SYSTEM
  60px   20px   40px




                       960px




 class="container_16"
960 GRID SYSTEM
  60px   20px   40px




                       960px


   site header class="grid_16"




 class="container_16"
960 GRID SYSTEM
   60px   20px   40px




                        960px


    site header class="grid_16"




content class="grid_12"
  class="container_16"
960 GRID SYSTEM
   60px   20px   40px




                        960px


    site header class="grid_16"




content class="grid_12"   sidebar
  class="container_16" class="grid_4"
960 GRID SYSTEM
                       60px   20px   40px




                                            960px


                        site header class="grid_16"
        feature A                           feature B
 class="grid_6 alpha"                  class="grid_6 omega"




                    body content                                           sidebar
                  class="container_16" class="grid_4"
              class="grid_12 alpha omega"
               content class="grid_12"
department A           department B                 department C
class="grid_4 alpha"      class="grid_4"            class="grid_4 omega"
YUI GRIDS CSS
YUI GRIDS CSS
<div id="doc3" class="yui-t6">
!    <div id="hd"><h1>Header</h1></div>
!    <div id="bd">
!    !    <div id="yui-main">
!    !    !    <div class="yui-b">
!    !    !    !    <div class="yui-g">
!    !    !    !    !    <div class="yui-u first">
!    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
!    !    !    !    !    </div>
!    !    !    !    !    <div class="yui-u">
!    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
!    !    !    !    !    </div>
!    !    !    !    </div>
!    !    !    !    <div class="yui-g">
!    !    !    !    !    <!-- YOUR DATA GOES HERE -->
!    !    !    !    </div>
!    !    !    !    <div class="yui-gb">
!    !    !    !    !    <div class="yui-u first">
!    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
!    !    !    !    !    </div>
!    !    !    !    !    <div class="yui-u">
!    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
!    !    !    !    !    </div>
!    !    !    !    !    <div class="yui-u">
!    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
!    !    !    !    !    </div>
!    !    !    !    </div>
!    !    !    </div>
!    !    </div>
!    !    <div class="yui-b">
!    !    !    <!-- YOUR NAVIGATION GOES HERE -->
!    !    </div>
!    </div>
   <div id="ft"><p>Footer</p></div>
</div>
YUI GRIDS CSS
               <div id="doc3" class="yui-t6">
               !                                     class="yui-t6" 300px right sidebar
                    <div id="hd"><h1>Header</h1></div>
               !    <div id="bd">
               !    !    <div id="yui-main">
               !    !    !    <div class="yui-b">
id="doc3" 100% width
               !
               !
                    !
                    !
                         !
                         !
                              !
                              !
                                   <div class="yui-g">
                                   !                           class="yui-g" 2-col sub-grid
                                        <div class="yui-u first">
               !    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
               !    !    !    !    !    </div>
               !    !    !    !    !    <div class="yui-u">
               !    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
               !    !    !    !    !    </div>
               !    !    !    !    </div>
               !    !    !    !    <div class="yui-g">
               !    !    !    !    !    <!-- YOUR DATA GOES HERE -->
               !    !    !    !    </div>
               !
               !
                    !
                    !
                         !
                         !
                              !
                              !
                                   <div class="yui-gb">
                                   !                            class="yui-gb" 3-col sub-grid
                                        <div class="yui-u first">
               !    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
               !    !    !    !    !    </div>
               !    !    !    !    !    <div class="yui-u">
               !    !    !    !    !    !    <!-- YOUR DATA GOES HERE   -->
               !    !    !    !    !    </div>
               !
               !
                    !
                    !
                         !
                         !
                              !
                              !
                                   !
                                   !
                                        <div class="yui-u">
                                        !                           class="yui-u" grid unit
                                             <!-- YOUR DATA GOES HERE-->
               !    !    !    !    !    </div>
               !    !    !    !    </div>
               !    !    !    </div>
               !    !    </div>
               !    !    <div class="yui-b">
               !    !    !    <!-- YOUR NAVIGATION GOES HERE -->
               !    !    </div>
               !    </div>
                  <div id="ft"><p>Footer</p></div>
               </div>
ANNOYED?
NON-SEMANTIC CLASSES
NON-SEMANTIC CLASSES


     class="span-9 last"

     class="grid_6 alpha"

       class="yui-t6"
NON-SEMANTIC CLASSES
               HTML4                                    HTML5 Draft

“The class attribute has several roles in   “Authors may use any value in the
 HTML:                                       class attribute, but are encouraged to
  • As a style sheet selector (when an       use the values that describe the nature
    author wishes to assign style            of the content, rather than values that
    information to a set of elements).       describe the desired presentation of the
  • For general purpose processing by        content.”
    user agents.”

“Good names don’t change

“Think about why you want something to look a certain way, and not really about
 how it should look. Looks can always change, but the reasons for giving something
 a look stay the same.”
NON-SEMANTIC CLASSES



     Let’s use our own classes!
PRESENTATIONAL
   THINKING
COLUMN GRIDS

      Blueprint         960 Grid System      YUI Grids CSS

                                                 fluid or
    950px fixed            960px fixed
                                           750/950/974px fixed

    24 columns           12/16 columns
                                                custom
    or custom              or custom
good docs, nice code,
                           nice code,        fluid and mixed
  any source order,
                        any source order         layouts
semantic classes
COLUMN GRIDS
BASELINE GRIDS
BASELINE GRIDS
           vertical rhythm              Heading 1
                                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel
                                        purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero


    default font 12px/18px
                                        egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget
                                        suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non,
                                        mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor.
                                        Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi.
                                        Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue
      h2   {                            non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida
      !     font-size:2em;              ultrices.

      !     line-height:1.5;
      !     margin-bottom:0.75em;
      }




 12px × 3 × 1 = 36px = 2 grids/line

12px × 3 × 0.5 = 18px = 1 grid margin
BASELINE GRIDS
           vertical rhythm              Heading 1
                                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel
                                        purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero


    default font 12px/18px
                                        egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget
                                        suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non,
                                        mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor.
                                        Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi.
                                        Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue
      h3   {                            non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida
      !     font-size:1.5em;            ultrices.

      !     line-height:1;
      !     margin-bottom:1em;          Heading 2
      }
                                        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel
                                        purus scelerisque sit amet vestibulum justo viverra.



 12px × 2 × 1.5 = 36px = 2 grids/line

12px × 2 × 0.75 = 36px = 2 grids/line
  12px × 3 × 1 = 18px = 1 grid margin

12px × 3 × 0.5 = 18px = 1 grid margin
BASELINE GRIDS
         vertical rhythm                 Heading 1
                                         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel
                                         purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero


    default font 12px/18px
                                         egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget
                                         suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non,
                                         mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor.
                                         Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi.
                                         Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue
                                         non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida
                                         ultrices.



                                         Heading 2
                                         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel
                                         purus scelerisque sit amet vestibulum justo viverra.


                                         Heading 3
 12px × 1.5 × 1 = 18px = 1 grids/line
                                         Cras posuere lobortis libero egestas suscipit. Donec aliquet, sem at ornare dictum,
                                         elit risus eleifend leo, eget suscipit ipsum nunc nec felis. Pellentesque lacus quam,

12px ×× 23× 1.5= 18px ==22grids/line
 12px × × 1 ==36px = 1 grid margin
  12px 1.5 × 1    36px     grids/line    iaculis sed imperdiet non, mollis sit amet lectus. Ut consequat malesuada lobortis.
                                         Integer et congue dolor.


12px × 2 × 0.75= 18px = 1 grid margin
 12px × 3 × 0.5 = 18px = 1 grid margin
BASELINE GRIDS
BASELINE GRIDS
BASELINE GRIDS
BASELINE GRIDS
BASELINE GRIDS
h1,   h2,   h3, h4, h5, h6!   {   position: relative; }
h1,   h2!   !    !   !   !    {   line-height: 36px; margin-bottom: 18px; }
h1,   h2,   h3, h4! !    !    {   margin-top: 18px; }
h3,   h4,   h5, h6! !    !    {   line-height: 18px; }
h1!   !     !    !   !   !    {   font-size: 36px; top: 5px; }
h2!   !     !    !   !   !    {   font-size: 28px; top: 8px; }
h3!   !     !    !   !   !    {   font-size: 22px; top: 1px; }
h4!   !     !    !   !   !    {   font-size: 18px; top: 2px; }
h5!   !     !    !   !   !    {   font-size: 15px; top: 4px; }
h6!   !     !    !   !   !    {   font-size: 13px; top: 5px; }
BASELINE GRIDS
ideal leading is font and design dependent




               Helvetica vs Calibri
    http://forabeautifulweb.com/blog/about/lead_weight
BASELINE GRIDS
ideal leading is font and design dependent




                Helvetica vs Times
    http://forabeautifulweb.com/blog/about/lead_weight
BASELINE GRIDS
ideal leading is font and design dependent




             Helvetica vs Helvetica
    http://forabeautifulweb.com/blog/about/lead_weight
BASELINE GRIDS
http://www.flickr.com/photos/therefore/18542525/




CSS PRE-FAB
CSS PRE-FAB



ready-made styles for documents made of prescribed
                    components
CSS PRE-FAB
CSS PRE-FAB




           <ul class="v6-9-9">
           !   <li class="a-magazine span-6"> content </li>
           !   <li class="a-subscribe span-9"> content </li>
           !   <li class="a-shop span-9 last"> content </li>
           </ul>




http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
CSS PRE-FAB




           <ul class="v9-6-9">
           !   <li class="a-magazine span-9"> content </li>
           !   <li class="a-subscribe span-6"> content </li>
           !   <li class="a-shop span-9 last"> content </li>
           </ul>




http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
CSS PRE-FAB




           <ul class="v9-9-6">
           !   <li class="a-magazine span-9"> content </li>
           !   <li class="a-subscribe span-9"> content </li>
           !   <li class="a-shop span-6 last"> content </li>
           </ul>




http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
CSS PRE-FAB
http://www.flickr.com/photos/bobalong/3410454292/




CSS ABSTRACTION
CSS ABSTRACTION


      “Adding any form of macros or additional scopes and
 indirections, including symbolic constants, is not just redundant,
but changes CSS in ways that make it unsuitable for its intended
  audience. Given that there is currently no alternative to CSS,
                  these things must not be added.”

       — Bert Bos, Why “variables” in CSS are harmful
CSS ABSTRACTION
SERVER-SIDE
FRAMEWORKS
SERVER-SIDE
FRAMEWORKS
      !sitepoint_bg = #036
      !sitepoint_fg = #F60

      #header
        background-color= !sitepoint_bg

        a:link
          color= !sitepoint_fg
        a:visited
          color= !sitepoint_fg - #830



      @import blueprint.css
      !blueprint_grid_columns = 16
      !blueprint_grid_width = 40px
      !blueprint_grid_margin = 20px

      +blueprint-grid

      #container
        +container

      #header
        +column(16)
SERVER-SIDE
FRAMEWORKS
      sitepoint_bg = #036
      sitepoint_fg = #F60

      #header:
        background-color: $sitepoint_bg

        a:link
          color: $sitepoint_fg
        a:visited
          color: $sitepoint_fg - #830
SERVER-SIDE
                   FRAMEWORKS


@constants {                          @grid {
!   sitepoint_bg:#036;                !   column-count:16;
!   sitepoint_fg:#F60;                !   column-width:40;
}                                     !   left-gutter-width:10;
                                      !   right-gutter-width:10;
#header {                             !   unit:px;
!   background-color:!sitepoint_bg;   }

!   a:link, a:visited {               #container {
!   !   color:!sitepoint_fg;            +container;
!   }                                 }
}
                                      #header {
                                        +columns(16);
                                      }
SERVER-SIDE
FRAMEWORKS
THREE QUESTIONS
THREE QUESTIONS


   What do CSS frameworks do?

 How do I choose a CSS framework?

   Are CSS frameworks pure evil?
FINAL THOUGHT



when all you have is a hammer…

  think outside the framework
THANKS!

   @sentience
kevin@sitepoint.com

Contenu connexe

En vedette

Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS Frameworks
Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS FrameworksDon’t get Bootslapped: How to Avoid Common Pitfalls with CSS Frameworks
Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS FrameworksWebVisions
 
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014FalafelSoftware
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationMelanie Archer
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptBryan Basham
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Aaron Gustafson
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSM R Rony
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedStéphane Bégaudeau
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An IntroductionManvendra Singh
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript ProgrammingSehwan Noh
 

En vedette (20)

Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS Frameworks
Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS FrameworksDon’t get Bootslapped: How to Avoid Common Pitfalls with CSS Frameworks
Don’t get Bootslapped: How to Avoid Common Pitfalls with CSS Frameworks
 
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
AngularJS in 60ish Minutes - Dan Wahlin | FalafelCON 2014
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundation
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]Fundamental JavaScript [UTC, March 2014]
Fundamental JavaScript [UTC, March 2014]
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
Reveal.js
Reveal.jsReveal.js
Reveal.js
 
Js ppt
Js pptJs ppt
Js ppt
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
reveal.js 3.0.0
reveal.js 3.0.0reveal.js 3.0.0
reveal.js 3.0.0
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 

Similaire à CSS Frameworks: Make the Right Choice (EOTW09)

The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSSRachel Andrew
 
GOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatGOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatRachel Andrew
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)Dinis Correia
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / BackgroundIn a Rocket
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustKyle Adams
 
New CSS Meets the Real World
New CSS Meets the Real WorldNew CSS Meets the Real World
New CSS Meets the Real WorldRachel Andrew
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid PrototypingEven Wu
 
Confoo: You can use CSS for that!
Confoo: You can use CSS for that!Confoo: You can use CSS for that!
Confoo: You can use CSS for that!Rachel Andrew
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)elliando dias
 
Attsf css kt
Attsf css ktAttsf css kt
Attsf css ktturp31
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learnerYoeung Vibol
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldRachel Andrew
 
An Event Apart Seattle - New CSS Layout Meets the Real World
An Event Apart Seattle - New CSS Layout Meets the Real WorldAn Event Apart Seattle - New CSS Layout Meets the Real World
An Event Apart Seattle - New CSS Layout Meets the Real WorldRachel Andrew
 
The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?Rachel Andrew
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / SpecificityIn a Rocket
 
パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用Koji Ishimoto
 

Similaire à CSS Frameworks: Make the Right Choice (EOTW09) (20)

The Creative New World of CSS
The Creative New World of CSSThe Creative New World of CSS
The Creative New World of CSS
 
GOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for thatGOTO Berlin - You can use CSS for that
GOTO Berlin - You can use CSS for that
 
HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)HTML&CSS 5 - Intermediate CSS (2/2)
HTML&CSS 5 - Intermediate CSS (2/2)
 
Think Vitamin CSS
Think Vitamin CSSThink Vitamin CSS
Think Vitamin CSS
 
16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background16- Learn CSS Fundamentals / Background
16- Learn CSS Fundamentals / Background
 
CSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie DustCSS3 is Not Magic Pixie Dust
CSS3 is Not Magic Pixie Dust
 
New CSS Meets the Real World
New CSS Meets the Real WorldNew CSS Meets the Real World
New CSS Meets the Real World
 
Rapid Prototyping
Rapid PrototypingRapid Prototyping
Rapid Prototyping
 
Next-level CSS
Next-level CSSNext-level CSS
Next-level CSS
 
Confoo: You can use CSS for that!
Confoo: You can use CSS for that!Confoo: You can use CSS for that!
Confoo: You can use CSS for that!
 
Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)Compass And Sass(Tim Riley)
Compass And Sass(Tim Riley)
 
Web Layout
Web LayoutWeb Layout
Web Layout
 
Attsf css kt
Attsf css ktAttsf css kt
Attsf css kt
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
An Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real WorldAn Event Apart DC - New CSS Layout meets the Real World
An Event Apart DC - New CSS Layout meets the Real World
 
An Event Apart Seattle - New CSS Layout Meets the Real World
An Event Apart Seattle - New CSS Layout Meets the Real WorldAn Event Apart Seattle - New CSS Layout Meets the Real World
An Event Apart Seattle - New CSS Layout Meets the Real World
 
The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?The Future of Frontend - what is new in CSS?
The Future of Frontend - what is new in CSS?
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity13- Learn CSS Fundamentals / Specificity
13- Learn CSS Fundamentals / Specificity
 
パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用
 

Dernier

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 

Dernier (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 

CSS Frameworks: Make the Right Choice (EOTW09)

  • 1. Edge of the Web 2009 CSS FRAMEWORKS make the right choice Kevin Yank sitepoint.com @sentience @sitepointdotcom
  • 2. CSS FRAMEWORKS “a set of tools, libraries, conventions, and best practices that attempt to abstract routine tasks into generic modules that can be reused” — Jeff Croft, Frameworks for Designers
  • 4. THREE QUESTIONS What do CSS frameworks do? How do I choose a CSS framework? Are CSS frameworks pure evil evil?
  • 6. CSS RESET http://www.flickr.com/photos/redux/3219068532/
  • 8. CSS RESET body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input, textarea,p,blockquote,th,td { ! margin:0; ! padding:0; } table { ! border-collapse:collapse; ! border-spacing:0; } fieldset,img { ! border:0; } address,caption,cite,code,dfn,em,strong,th,var { ! font-style:normal; ! font-weight:normal; } ol,ul { ! list-style:none; } caption,th { ! text-align:left; } * { h1,h2,h3,h4,h5,h6 { ; rgin:0 ; ! font-size:100%; ! font-weight:normal; ma 0 dding: } q:before,q:after { ! content:''; pa } abbr,acronym { } ! border:0; }
  • 9. CSS RESET YUI Reset CSS Eric Meyer’s Reset CSS leaves critical styles alone resets critical styles ins left underlined no :focus outline, unstyled ins sets default font styles attempts to inherit font styles strong not bold, em not italic leaves built-in font styles
  • 10. CSS RESET YUI Reset CSS Eric Meyer’s Reset CSS leaves critical styles alone resets critical styles ins left underlined no :focus outline, unstyled ins sets default font styles attempts to inherit font styles strong not bold, em not italic leaves built-in font styles
  • 12. CONTROVERSY IN MICROCOSM
  • 13. CONTROVERSY IN MICROCOSM “The problem I’vetake style effectsresets is is that then find me “I“The problem I’ve had with thesefor granted. […] It makes don’t want to had with these resets that I I then find myself think just that littlemore thanever needed to just toof get myself declaring much bit than I Iaboutneeded to just toget declaring much more harder ever the semantics my browsers back to tothe resetthings theI way I want.strongturns document. With renderingin place, don’t Ipick As ititturns browsers back rendering things the way want. As because out,the I’m perfectly for boldfacing. Instead, I pickelements render out, design calls happy with how number ofof the right element— I’m perfectly happy with how a a number elements render by default. I like strongto have or b or andor whatever—and then by default.it’slike lists have bullets and strong elements to whether I lists to or em bullets h3 strong elements to have bolded text.” ” ” have boldedneeded. style it as text. — — Jonathan Snook, No CSS Reset Jonathan Meyer, Reset Reasoning — Eric Snook, No CSS Reset
  • 14. CONTROVERSY IN MICROCOSM “The problemto take style effects for granted. […]then find meme “I don’t want I’vetake style effectsresets is that […]makes “I don’t want to had with these for granted. I It It makes myself thinkjust that little bit harder Iabout needed to justof my my think just that little bit than ever the semantics toof declaring much more harder about the semantics get browsers back to renderingin in place,don’t pick strongitbecause document. With the reset things theI way I want.strong because document. With the reset place, I don’t pick As turns out,thedesign callshappyboldfacing. Instead, I pickelements render the design calls for with how a number of the right element— I’m perfectly for boldfacing. Instead, I pick the right element— by whether Iit’s strong oror em or oror h3strong elementsthen default. like stronghave or b b h3 or or whatever—and then whether it’s lists to em bullets and whatever—and to have bolded text.” ” ” style it asas needed. style it needed. — Eric Meyer, Reset Reasoning — Jonathan Meyer, Reset Reasoning — Eric Snook, No CSS Reset
  • 15. CONTROVERSY IN MICROCOSM
  • 19. COLUMN GRIDS Blueprint 960 Grid System YUI Grids CSS fluid or 950px fixed 960px fixed 750/950/974px fixed 24 columns 12/16 columns custom or custom or custom good docs, nice code, nice code, fluid and mixed any source order any source order layouts
  • 20. BLUEPRINT 30px 10px 950px
  • 21. BLUEPRINT 30px 10px 950px class="container"
  • 22. BLUEPRINT 30px 10px 950px site header class="span-24" class="container"
  • 23. BLUEPRINT 30px 10px 950px site header class="span-24" content class="span-18" class="container"
  • 24. BLUEPRINT 30px 10px 950px site header class="span-24" sidebar content class="span-18" class="span-6 class="container" last"
  • 25. BLUEPRINT 30px 10px 950px site header class="span-24" feature A class="span-9" sidebar class="span-6 class="container" last" content class="span-18"
  • 26. BLUEPRINT 30px 10px 950px site header class="span-24" feature A feature B class="span-9" class="span-9 last" sidebar class="span-6 class="container" last" content class="span-18"
  • 27. BLUEPRINT 30px 10px 950px site header class="span-24" feature A feature B class="span-9" class="span-9 last" sidebar body content class="container" class="span-6 class="span-18 last" last" content class="span-18"
  • 28. BLUEPRINT 30px 10px 950px site header class="span-24" feature A feature B class="span-9" class="span-9 last" sidebar body content class="container" class="span-6 class="span-18 last" last" content class="span-18" department A department B department C class="span-6" class="span-6" class="span-6 last"
  • 29. 960 GRID SYSTEM 60px 20px 40px 960px
  • 30. 960 GRID SYSTEM 60px 20px 40px 960px class="container_16"
  • 31. 960 GRID SYSTEM 60px 20px 40px 960px site header class="grid_16" class="container_16"
  • 32. 960 GRID SYSTEM 60px 20px 40px 960px site header class="grid_16" content class="grid_12" class="container_16"
  • 33. 960 GRID SYSTEM 60px 20px 40px 960px site header class="grid_16" content class="grid_12" sidebar class="container_16" class="grid_4"
  • 34. 960 GRID SYSTEM 60px 20px 40px 960px site header class="grid_16" feature A feature B class="grid_6 alpha" class="grid_6 omega" body content sidebar class="container_16" class="grid_4" class="grid_12 alpha omega" content class="grid_12" department A department B department C class="grid_4 alpha" class="grid_4" class="grid_4 omega"
  • 36. YUI GRIDS CSS <div id="doc3" class="yui-t6"> ! <div id="hd"><h1>Header</h1></div> ! <div id="bd"> ! ! <div id="yui-main"> ! ! ! <div class="yui-b"> ! ! ! ! <div class="yui-g"> ! ! ! ! ! <div class="yui-u first"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! <div class="yui-u"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! </div> ! ! ! ! <div class="yui-g"> ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! </div> ! ! ! ! <div class="yui-gb"> ! ! ! ! ! <div class="yui-u first"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! <div class="yui-u"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! <div class="yui-u"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! </div> ! ! ! </div> ! ! </div> ! ! <div class="yui-b"> ! ! ! <!-- YOUR NAVIGATION GOES HERE --> ! ! </div> ! </div> <div id="ft"><p>Footer</p></div> </div>
  • 37. YUI GRIDS CSS <div id="doc3" class="yui-t6"> ! class="yui-t6" 300px right sidebar <div id="hd"><h1>Header</h1></div> ! <div id="bd"> ! ! <div id="yui-main"> ! ! ! <div class="yui-b"> id="doc3" 100% width ! ! ! ! ! ! ! ! <div class="yui-g"> ! class="yui-g" 2-col sub-grid <div class="yui-u first"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! <div class="yui-u"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! </div> ! ! ! ! <div class="yui-g"> ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! </div> ! ! ! ! ! ! ! ! <div class="yui-gb"> ! class="yui-gb" 3-col sub-grid <div class="yui-u first"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! <div class="yui-u"> ! ! ! ! ! ! <!-- YOUR DATA GOES HERE --> ! ! ! ! ! </div> ! ! ! ! ! ! ! ! ! ! <div class="yui-u"> ! class="yui-u" grid unit <!-- YOUR DATA GOES HERE--> ! ! ! ! ! </div> ! ! ! ! </div> ! ! ! </div> ! ! </div> ! ! <div class="yui-b"> ! ! ! <!-- YOUR NAVIGATION GOES HERE --> ! ! </div> ! </div> <div id="ft"><p>Footer</p></div> </div>
  • 40. NON-SEMANTIC CLASSES class="span-9 last" class="grid_6 alpha" class="yui-t6"
  • 41. NON-SEMANTIC CLASSES HTML4 HTML5 Draft “The class attribute has several roles in “Authors may use any value in the HTML: class attribute, but are encouraged to • As a style sheet selector (when an use the values that describe the nature author wishes to assign style of the content, rather than values that information to a set of elements). describe the desired presentation of the • For general purpose processing by content.” user agents.” “Good names don’t change “Think about why you want something to look a certain way, and not really about how it should look. Looks can always change, but the reasons for giving something a look stay the same.”
  • 42. NON-SEMANTIC CLASSES Let’s use our own classes!
  • 43. PRESENTATIONAL THINKING
  • 44. COLUMN GRIDS Blueprint 960 Grid System YUI Grids CSS fluid or 950px fixed 960px fixed 750/950/974px fixed 24 columns 12/16 columns custom or custom or custom good docs, nice code, nice code, fluid and mixed any source order, any source order layouts semantic classes
  • 47. BASELINE GRIDS vertical rhythm Heading 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero default font 12px/18px egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non, mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor. Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi. Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue h2 { non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida ! font-size:2em; ultrices. ! line-height:1.5; ! margin-bottom:0.75em; } 12px × 3 × 1 = 36px = 2 grids/line 12px × 3 × 0.5 = 18px = 1 grid margin
  • 48. BASELINE GRIDS vertical rhythm Heading 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero default font 12px/18px egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non, mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor. Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi. Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue h3 { non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida ! font-size:1.5em; ultrices. ! line-height:1; ! margin-bottom:1em; Heading 2 } Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel purus scelerisque sit amet vestibulum justo viverra. 12px × 2 × 1.5 = 36px = 2 grids/line 12px × 2 × 0.75 = 36px = 2 grids/line 12px × 3 × 1 = 18px = 1 grid margin 12px × 3 × 0.5 = 18px = 1 grid margin
  • 49. BASELINE GRIDS vertical rhythm Heading 1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel purus scelerisque sit amet vestibulum justo viverra. Cras posuere lobortis libero default font 12px/18px egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget suscipit ipsum nunc nec felis. Pellentesque lacus quam, iaculis sed imperdiet non, mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor. Etiam mi lacus, eleifend ac ornare id, malesuada et metus. Etiam et lacus nisi. Fusce justo justo, lobortis nec mollis in, laoreet tempor velit. Phasellus vel augue non ligula condimentum dapibus. Pellentesque nec turpis egestas sapien gravida ultrices. Heading 2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sollicitudin nisl vel purus scelerisque sit amet vestibulum justo viverra. Heading 3 12px × 1.5 × 1 = 18px = 1 grids/line Cras posuere lobortis libero egestas suscipit. Donec aliquet, sem at ornare dictum, elit risus eleifend leo, eget suscipit ipsum nunc nec felis. Pellentesque lacus quam, 12px ×× 23× 1.5= 18px ==22grids/line 12px × × 1 ==36px = 1 grid margin 12px 1.5 × 1 36px grids/line iaculis sed imperdiet non, mollis sit amet lectus. Ut consequat malesuada lobortis. Integer et congue dolor. 12px × 2 × 0.75= 18px = 1 grid margin 12px × 3 × 0.5 = 18px = 1 grid margin
  • 54. BASELINE GRIDS h1, h2, h3, h4, h5, h6! { position: relative; } h1, h2! ! ! ! ! { line-height: 36px; margin-bottom: 18px; } h1, h2, h3, h4! ! ! { margin-top: 18px; } h3, h4, h5, h6! ! ! { line-height: 18px; } h1! ! ! ! ! ! { font-size: 36px; top: 5px; } h2! ! ! ! ! ! { font-size: 28px; top: 8px; } h3! ! ! ! ! ! { font-size: 22px; top: 1px; } h4! ! ! ! ! ! { font-size: 18px; top: 2px; } h5! ! ! ! ! ! { font-size: 15px; top: 4px; } h6! ! ! ! ! ! { font-size: 13px; top: 5px; }
  • 55. BASELINE GRIDS ideal leading is font and design dependent Helvetica vs Calibri http://forabeautifulweb.com/blog/about/lead_weight
  • 56. BASELINE GRIDS ideal leading is font and design dependent Helvetica vs Times http://forabeautifulweb.com/blog/about/lead_weight
  • 57. BASELINE GRIDS ideal leading is font and design dependent Helvetica vs Helvetica http://forabeautifulweb.com/blog/about/lead_weight
  • 60. CSS PRE-FAB ready-made styles for documents made of prescribed components
  • 62. CSS PRE-FAB <ul class="v6-9-9"> ! <li class="a-magazine span-6"> content </li> ! <li class="a-subscribe span-9"> content </li> ! <li class="a-shop span-9 last"> content </li> </ul> http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
  • 63. CSS PRE-FAB <ul class="v9-6-9"> ! <li class="a-magazine span-9"> content </li> ! <li class="a-subscribe span-6"> content </li> ! <li class="a-shop span-9 last"> content </li> </ul> http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
  • 64. CSS PRE-FAB <ul class="v9-9-6"> ! <li class="a-magazine span-9"> content </li> ! <li class="a-subscribe span-9"> content </li> ! <li class="a-shop span-6 last"> content </li> </ul> http://forabeautifulweb.com/blog/about/an_appropriate_use_for_css_frameworks/
  • 67. CSS ABSTRACTION “Adding any form of macros or additional scopes and indirections, including symbolic constants, is not just redundant, but changes CSS in ways that make it unsuitable for its intended audience. Given that there is currently no alternative to CSS, these things must not be added.” — Bert Bos, Why “variables” in CSS are harmful
  • 70. SERVER-SIDE FRAMEWORKS !sitepoint_bg = #036 !sitepoint_fg = #F60 #header background-color= !sitepoint_bg a:link color= !sitepoint_fg a:visited color= !sitepoint_fg - #830 @import blueprint.css !blueprint_grid_columns = 16 !blueprint_grid_width = 40px !blueprint_grid_margin = 20px +blueprint-grid #container +container #header +column(16)
  • 71. SERVER-SIDE FRAMEWORKS sitepoint_bg = #036 sitepoint_fg = #F60 #header: background-color: $sitepoint_bg a:link color: $sitepoint_fg a:visited color: $sitepoint_fg - #830
  • 72. SERVER-SIDE FRAMEWORKS @constants { @grid { ! sitepoint_bg:#036; ! column-count:16; ! sitepoint_fg:#F60; ! column-width:40; } ! left-gutter-width:10; ! right-gutter-width:10; #header { ! unit:px; ! background-color:!sitepoint_bg; } ! a:link, a:visited { #container { ! ! color:!sitepoint_fg; +container; ! } } } #header { +columns(16); }
  • 75. THREE QUESTIONS What do CSS frameworks do? How do I choose a CSS framework? Are CSS frameworks pure evil?
  • 76. FINAL THOUGHT when all you have is a hammer… think outside the framework
  • 77. THANKS! @sentience kevin@sitepoint.com