SlideShare a Scribd company logo
1 of 89
Download to read offline
Drupal theming using the
 960.gs grid system
 Originally presented at DrupalCamps Copenhagen,
 Helsinki, and Stockholm 2009




May, 2009 | Todd Ross Nienkerk
Personal introduction
Todd Ross Nienkerk
 ‣   Co-founder of Four Kitchens, a Drupal
     design and development firm in
     Austin, Texas
 ‣   One of the implementers of the new
     Drupal.org redesign
 ‣   Member of the Drupal documentation
     team


Photo: Kristin Hillery
What is a grid system?
History of the grid
 ‣   The practice of using a grid to guide design and
     page layout is nearly a century old
 ‣   In the 1910s and 1920s, ornamental design gave
     way to Rationalism and New Objectivity
 ‣   This shift in design was part of a much larger
     movement towards function over form
     ‣   Helvetica typeface and Bauhaus architecture


Source: Grids are Good by Khoi Vinh and Mark Boulton
Typographic grids
 ‣   After World War II, a number of graphic designers,
     influenced by the modernist ideas of Die neue
     Typographie (The New Typography), questioned
     the relevance of the conventional page layout of
     the time
 ‣   They devised a flexible system to help designers
     achieve coherency in organizing the page



Source: Grid (page layout) on Wikipedia
‣   The result was the modern typographic grid
     associated with the International Typographic
     Style
 ‣   Grid Systems in Graphic Design, the seminal work
     on the subject, helped propagate the use of the
     grid in Europe and, later, in North America




Source: Grid (page layout) on Wikipedia
Nearly a century ago
 ‣   Modernists looked to build a new aesthetic by...
     ‣   deriving beauty from the innate qualities of the
         machine
     ‣   championing standardization
 ‣   Sound familiar?




Source: Grids are Good by Khoi Vinh and Mark Boulton
Today
 ‣   Web designers have turned to grid-based design
     in order to...
     ‣   derive beauty from the innate qualities of the
         browser
     ‣   champion standardization
 ‣   16 years after the invention of the web, we are
     finally embracing a century-old design philosophy

Source: Grids are Good by Khoi Vinh and Mark Boulton
Grid systems on the web
    ‣   On the web, grid systems usually take the form of
        CSS frameworks
    ‣   A framework is a “reuseable abstraction of code
        wrapped in a well-defined API”1
    ‣   A collection of tools and shortcuts designed to
        minimize code and make your life easier



1   Source: Software framework on Wikipedia
Examples of frameworks
‣   Ruby on Rails is a well-known Ruby framework
‣   jQuery is a JavaScript framework
‣   Drupal itself can be considered a web application
    framework
    ‣   Includes many APIs for working with databases,
        fields, and web forms
CSS frameworks
‣   Apply the principles of software frameworks to
    web design
‣   They provide standardized rules and shortcuts for:
    ‣   browser resets
    ‣   typography
    ‣   navigation
    ‣   print style
    ‣   and...
Layout
‣   When applied to web design, grid systems are CSS
    frameworks that provides standardized rules and
    shortcuts for building a website’s layout
Why use a grid system?
1) Saves time

2) Saves money

3) Reduces frustration
Stop reinventing the
wheel
‣   Reduces the amount of CSS and markup you need
    to duplicate each time you start a project
‣   No need to refer to old projects to figure out how
    to implement layouts
Stop fixing and start
designing
‣   Shortens testing phases by providing built-in
    support for noncompliant browsers
    ‣   Minimize Internet Explorer hacks in your layout
‣   A well-tested grid system will rarely be the source
    of your problems
Stop deconstructing CSS
‣   Understanding someone else’s design is much
    easier when a standard grid system is used
How do grid systems
work?
Columns
 ‣   Grid systems are built
     using columns
     ‣   Columns are a grid
         system’s smallest unit
         of measurement
 ‣   Most grid systems
     contain 12–16 columns


Example based on 960.gs (12-column)
Column width
 ‣   Page regions (header,
     content, sidebars, etc.)
     are defined by column
     width
 ‣   As in: “The header is
     eight columns wide”




Example based on 960.gs (12-column)
Gutters (margins)
 ‣   Margins or padding are
     used to create gutters
     between columns
 ‣   These gutters provide
     margins between page
     regions




Example based on 960.gs (12-column)
Lean and versatile CSS
‣   A grid system’s CSS should:
    ‣   Be lean and efficient
    ‣   Be versatile and reusable
    ‣   Ensure consistent behavior across all common
        browsers — even IE6
Wrapping <div> elements
‣   In fixed-width grid systems, the entire layout is
    wrapped inside a single <div> element

‣   <div> elements wrap the page regions and define
    their widths according to the number of columns
    they span

    ‣   These <div> elements may be nested to create
        regions within regions
Floating <div> elements
 ‣   The wrapping <div>                         class: grid-12
     elements are assigned
     a column width using a            class:         class:
                                       grid-4         grid-4
     CSS class                                                    class:
                                                                 grid-4
 ‣   Because these classes                class: grid-8
     also float the elements,
     they simply fall into
                                      class: grid-6       class: grid-6
     place on the page


Example based on 960.gs (12-column)
What can grid systems
look like?
Examples of grid-based layouts
Layout A: Content left, sidebar right




Example based on 960.gs (12-column)
Layout B: Content between sidebars




Example based on 960.gs (12-column)
Layout C: Content right with two left sidebars




Example based on 960.gs (12-column)
Layout D: Whatever




Example based on 960.gs (12-column)
Layout E: The Mondriaan




Painting by Piet Mondriaan (later Mondrian)
How 960.gs works
What is 960.gs?
 ‣   960.gs — also known as the 960 Grid System —
     was created by Nathan Smith in order to
     “streamline web development workflow”
 ‣   It’s both a prototyping and development
     framework
     ‣   “The premise of the system is ideally suited to
         rapid prototyping, but it would work equally well
         when integrated into a production environment.”

Source: 960.gs
What’s in it
 ‣   Download it for free at http://960.gs
 ‣   GPL and MIT licensed
 ‣   The 960.gs download includes:
     ‣   Printable sketch sheets for doodling
     ‣   Design templates for all most applications:
         Photoshop, Illustrator, Inkscape, OmniGraffle, etc.


Source: 960.gs
Technical specs
 ‣   960px wide with a 940px usable area
 ‣   Two versions: 12- and 16-column
     ‣   These can be implemented separately or
         simultaneously
 ‣   Each column has a 10px margin on the left and
     right, which creates a 20px gutter between
     columns


Source: 960.gs
12-column version
     Columns are 60px wide              Gutters are 20px wide




      10px margin on the left and     Available
      right prevents collision with   working area
      browser chrome                  is 940px wide


Source: 960.gs
16-column version
     Columns are 40px wide




                      Everything else remains the same



Source: 960.gs
Using both versions
simultaneously
‣   You can use 12-column classes inside a 16-column
    grid — and vice versa
‣   This is possible because 12 and 16 are both
    multiples of 2 and 4

                ‣   2 * 6 = 12   ‣   4 * 3 = 12

                ‣   2 * 8 = 16   ‣   4 * 4 = 16
‣   In other words, when you divide the layout into
    halves and quarters, you can use 12- and 16-
    column version simultaneously
‣   Watch what happens when you lay one grid on top
    of the other:

                                       Halves




                                      Quarters
‣   This flexibility allows designers to work with both
    60px- and 40px-wide columns




‣   If 12 or 16 columns don’t suit you, 960 is also
    divisible by 2, 3, 4, 5, 6, 8, 10, 15, 20, 24, 30, 32, 40,
    48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480
CSS and markup
Note: 960.gs uses underscores in its CSS class names. To avoid confusion, the
examples that follow will use hyphens instead, as this is The Drupal Way.
Containers
‣   Grids must be wrapped
    in a container <div>
                            .container-12,
                            .container-16 {
‣   Containers center the     margin-left: auto;
    content and define         margin-right: auto;
    which version of the      width: 960px;
                            }
    grid will be
    implemented
Grids
‣   Grids are held inside      .grid-1,
                               .grid-2,
    containers and are         .grid-3,
    floated left so they fall     ...
    into place                 .grid-16 {
                                  display: inline;
    automatically                 float: left;
                                  position: relative;
‣   They also provide 10px        margin-left: 10px;
    margins on the left and       margin-right: 10px;
                               }
    right
Grid widths
‣   The width of each grid
    is determined by the      .container-12 .grid-1 {
    container that wraps it     width: 60px;
                              }
‣   For example, a one-
                              .container-16 .grid-1 {
    column grid is either       width: 40px;
    60px or 40px              }
    depending on whether
    it’s a 12- or 16-column
    layout
‣   Note that grid width does not increase by 60px or
    40px each time

‣   Each increase must account for the 20px gutter
    between grids

       .container-12 .grid-1 {   .container-16 .grid-1 {
         width: 60px;              width: 40px;
       }                         }

       .container-12 .grid-2 {   .container-16 .grid-2 {
         width: 140px;             width: 100px;
       }                         }

       .container-12 .grid-3 {   .container-16 .grid-3 {
         width: 300px;             width: 160px;
       }                         }
Putting containers and
grids together
.container-12



 .grid-3        .grid-6   .grid-3
Prefixes and suffixes
‣   If you want to leave
    space between              .container-12 .prefix-1 {
    columns, use a prefix         padding-left: 80px;
    or suffix class              }

                               .container-12 .suffix-1 {
‣   Prefix classes add            padding-right: 80px;
    padding to the left of a   }
    column
‣   Suffix classes add
    padding to the right
Adding a prefix and suffix

.container-12

                 .grid-4
 .grid-3        .prefix-1   .grid-3
                .suffix-1
Multiple rows
.container-12

                .grid-12



                 .grid-4
 .grid-3        .prefix-1   .grid-3
                .suffix-1
Multiple rows: markup
                      <div class="container-12">
The container <div>
 defines the layout      <!-- row 1 -->
                        <div class="grid-12">
     version in use
                           This grid occupies the full width
                        </div>

                        <!-- row 2 -->
                        <div class="grid-3">
                           One wide
    No need to put
                        </div>
each row in its own     <div class="grid-4 prefix-1 suffix-1">
    wrapping <div>         Four wide with a prefix and suffix of one each
                        </div>
                        <div class="grid-3">
                           One wide
                        </div>

                      </div> <!-- /container -->
Stack content vertically
with nested grids
                          .grid-6
.container-12

                .grid-6
 .grid-3                  .grid-3
                .grid-6
‣   Here’s the catch: Because each grid includes a
    10px left and right margin, nesting grids can break
    your layout
                                             .grid-6
    .container-12

                            .grid-6
      .grid-3
                            .grid-6


      .grid-3
Alpha and omega fix
broken nesting
‣   When nesting grids, use the alpha and omega
    classes to remove the margins
    ‣   alpha removes the left margin. It’s the first nested
        grid.
    ‣   omega removes the right margin. It’s the last
        nested grid.
.grid-6
.container-12

               .grid-3      .grid-3
                .alpha       .omega
 .grid-3                                    .grid-3
                       .grid-6
                    .alpha .omega


       .alpha removed          .omega removed
       the left margin        the right margin
Additional resources
‣   960 Gridder and bookmarklet
‣   Variable grid system generator
‣   Other grid systems based on 960.gs
    ‣   Fluid 960.gs
    ‣   Typogridphy: Typographical and grid layout CSS
        framework
    ‣   and...
The NineSixty theme
Drupal’s implementation of 960.gs is even better
than the original

http://drupal.org/project/ninesixty
About NineSixty
 ‣   NineSixty is the Drupal port of 960.gs
 ‣   Developed by Joon Park, aka dvessel on
     Drupal.org
 ‣   Intended to be used as a base theme
 ‣   Currently a candidate for Drupal 7 core
     ‣   Follow the debate on groups.drupal.org


Source: Drupal.org
NineSixty’s improvements
‣   Content-first layout using “push” and “pull” classes
‣   Dynamic grid widths based on context
‣   Debugging tools and grid visualization
‣   Right-to-left (RTL) language support
Content-first layout
‣   A design convention in which the content is output
    as close to the top of the markup as possible
    ‣   Content should be output before all sidebars
    ‣   Some designers believe it should be output
        before a site’s main navigation
‣   This can be very difficult to achieve on a site with
    one or more left columns
Push and pull classes
‣   Content-first layout can be achieved in NineSixty
    by “pushing” the content grid to the right while
    “pulling” a sidebar to the left
‣   These classes use the same naming convention
    as .grid-X, .prefix-X, and .suffix-X, where X is the
    grid’s width:
    ‣   .push-X and .pull-X
‣   Push and pull values should match the grid value
     of the opposite grid

      <div class="container-12">
        <div id="content" class="grid-6 push-3">
                                                    Match numbers to
          Content
                                                    swap locations
        </div>

         <div id="sidebar-left"   class="grid-3 pull-6">
           Sidebar: Left
         </div>

        <div id="sidebar-right" class="grid-3">
          Sidebar: Right
        </div>
      </div>




Source: NineSixty’s README.txt
Before adding push and pull
.container-12



            .grid-6                  .grid-3         .grid-3




         <div class="container-12">
           <div id="content" class="grid-6">
             Content
           </div>
           <div id="sidebar-left" class="grid-3">
             Sidebar: Left
           </div>
           <div id="sidebar-right" class="grid-3">
             Sidebar: Right
           </div>
         </div>
After adding push and pull
.container-12


   .grid-3                  .grid-6
                                                      .grid-3
   .pull-6                  .push-3




         <div class="container-12">
           <div id="content" class="grid-6 push-3">
             Content
           </div>
           <div id="sidebar-left" class="grid-3 pull-6">
             Sidebar: Left
           </div>
           <div id="sidebar-right" class="grid-3">
             Sidebar: Right
           </div>
         </div>
Dynamic grid widths
‣   In some cases, you may want grids to resize
    themselves when a region isn’t populated
    ‣   For example, a 3-6-3 layout should become 3-9 if
        the right column is empty
‣   Dynamic width assignment is handled using the
    ns() function

    ‣   Defined in template.php
Structure of ns()
                          These “pairs”
         Default        subtract from the
          value           default value



       ns('class-X', $region, Y, $region, Z, ...)




   ‣   X, Y, and Z are all width values

   ‣   class can be grid, prefix, suffix, push, or pull

   ‣   $region can be any theme region

   ‣   Use as many pairs as you like
Implementing ns()
               From page.tpl.php:
               <div id="main" class="column <?php print ns('grid-16', $left,
               4, $right, 3) . ' ' . ns('push-4', !$left, 4); ?>">
                   <?php print $content; ?>
               </div>

               <?php if ($left): ?>
                 <div id="sidebar-left" class="column sidebar region grid-4 <?
               php print ns('pull-12', $right, 3); ?>">
                   <?php print $left; ?>
                 </div>
               <?php endif; ?>

               <?php if ($right): ?>
                 <div id="sidebar-right" class="column sidebar region grid-3">
                   <?php print $right; ?>
                 </div>
               <?php endif; ?>




Source: NineSixty’s page.tpl.php
From #main:
                   <?php print ns('grid-16', $left, 4, $right, 3)
                   . ' ' . ns('push-4', !$left, 4); ?>


                                     If left sidebar is       If right sidebar is
                Default            present, subtract 4       present, subtract 3
                 width             from default width.       from default width.



                   ns('grid-16', $left, 4, $right, 3)



                                         If left sidebar is not present, subtract
                 Default                 4 from the push value. This will result
                push value                         in no push, as 4-4 = 0



                   ns('push-4', !$left, 4)



Source: NineSixty’s page.tpl.php
From #sidebar-left:
                   <?php php print ns('pull-12', $right, 3); ?>



                                      If right sidebar is
                Default              present, subtract 3
               pull value          from default pull value



                   ns('pull-12', $right, 3)




Source: NineSixty’s page.tpl.php
NineSixty in action
‣   Visit http://ninesixty.fkdemos.com to see how
    NineSixty...
    ‣   uses push and pull classes to generate content-
        first layout
    ‣   dynamically assigns grid widths based on
        context
    ‣   can be used to create different layouts
Implementing a grid-
based layout
Using NineSixty to build your site
When not to use a grid
‣   Implementing a grid will probably be impossible if
    your site’s layout...
    ‣   uses irregular column sizes
    ‣   has irregular margins or gutters
    ‣   has a width that isn’t divisible by a sane number
‣   Implementing a grid will be difficult — but not
    impossible — if your site’s layout...
    ‣   has gutter widths of odd numbers
    ‣   is fluid
    ‣   wasn’t designed on a grid
Getting started
‣   Do not change the NineSixty theme on your site!
    ‣   Hacking NineSixty is like hacking core: It will
        make upgrading your site very difficult
‣   Instead, subtheme NineSixty or create a totally
    new theme based on NineSixty
Subtheme
‣   This method is best if your site is (or can be)
    960px wide and can utilize 12 or 16 columns
‣   Subtheming instructions and resources on
    Drupal.org:
    ‣   Subtheming quick and dirty
    ‣   Sub-themes, their structure and inheritance
Build a new theme
‣   You should build a new theme when your site’s
    layout...
    ‣   isn’t 960px wide
    ‣   doesn’t use 12 or 16 columns
‣   It’s more efficient to use a new theme than to
    override virtually all of NineSixty’s CSS
Do the math
 ‣   Be prepared to crunch numbers
 ‣   Building a new theme can be very confusing
     ‣   Spreadsheets can help you visualize column,
         margins, and gutters




Image source: Client project
The grid equation
     (Canvas - ((Total units - 1) x Gutter)) ÷ Total units = Unit


 ‣   Examples (remember that the true “canvas” size of
     960.gs is actually 940px):

     ‣   (940 - ((12 - 1) x 20)) ÷ 12 = 60

     ‣   (940 - ((16 - 1) x 20)) ÷ 16 = 40




Source: Grids are Good by Khoi Vinh and Mark Boulton
Case study

Four Kitchens’ company
website
‣   Subtheme of NineSixty
                           ‣   12-column version




Source: fourkitchens.com
Source: fourkitchens.com/blog
Header promos                   Right column
       grid-4                   grid-3




Content column
        grid-8                  Gutter
                                grid-1




Source: fourkitchens.com/blog
Source: fourkitchens.com
Content column                             Gutter   Right column
        grid-8                             grid-1   grid-3




 Footer
columns
 grid-3




    Sub-footer              Gutter     Sub-footer
content column             grid-1    right column
        grid-8                             grid-3


Source: fourkitchens.com
Appendix
Learn more about grids
‣   The Grid System
    ‣   “The ultimate resource in grid systems”
‣   The Grid System’s Flickr pool
‣   My bookmarks tagged “gridsystems”
Downloads
‣   960 grid system: 960.gs
‣   NineSixty theme for Drupal: drupal.org/project/
    ninesixty
‣   This and other presentations are available for
    download at fourkitchens.com/presentations
Contact me
‣   Email: todd@fourkitchens.com
    ‣   also works for Google Chat and AIM
‣   Skype: toddatfk
‣   Twitter: twitter.com/toddross
Credits
‣   “History of the grid” slides were   ‣   This presentation was created and
    borrowed heavily from Khoi Vinh         delivered by Todd Ross Nienkerk,
    and Mark Boulton’s presentation         co-founder of Four Kitchens
    Grids are Good and from
    Wikipedia

‣   Piet Mondriaan painting was found
    somewhere online. Copyright
    holder is unknown

‣   The items listed above are exempt
    from this presentation’s Creative
    Commons license
All content in this presentation, except where noted otherwise, is Creative Commons Attribution-
ShareAlike 3.0 licensed and copyright 2009 Four Kitchen Studios, LLC.

More Related Content

Similar to Drupal theming using the 960.gs grid system

Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)Four Kitchens
 
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Four Kitchens
 
Accelerated grid theming using NineSixty (DrupalCamp Dallas)
Accelerated grid theming using NineSixty (DrupalCamp Dallas)Accelerated grid theming using NineSixty (DrupalCamp Dallas)
Accelerated grid theming using NineSixty (DrupalCamp Dallas)Four Kitchens
 
Accelerated Grid Theming
Accelerated Grid ThemingAccelerated Grid Theming
Accelerated Grid ThemingNathan Smith
 
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)Four Kitchens
 
MW2011 Grid-based Web Design presentation
MW2011 Grid-based Web Design presentationMW2011 Grid-based Web Design presentation
MW2011 Grid-based Web Design presentationCharlie Moad
 
Grid system- cbil360.com
Grid system- cbil360.comGrid system- cbil360.com
Grid system- cbil360.comPhillip Turner
 
Web I - 07 - CSS Frameworks
Web I - 07 - CSS FrameworksWeb I - 07 - CSS Frameworks
Web I - 07 - CSS FrameworksRandy Connolly
 
DUG: Grids & Panels
DUG: Grids & PanelsDUG: Grids & Panels
DUG: Grids & PanelsPure Sign
 
CSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteCSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteMario Hernandez
 
Drupal 960 grid system based theming
Drupal 960 grid system based theming Drupal 960 grid system based theming
Drupal 960 grid system based theming Gaurav Mishra
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS LayoutZoe Gillenwater
 
MySQL Schema Design in Practice
MySQL Schema Design in PracticeMySQL Schema Design in Practice
MySQL Schema Design in PracticeJaime Crespo
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSRachel Andrew
 
New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)Igalia
 
Maintainable theming
Maintainable themingMaintainable theming
Maintainable themingWunderkraut
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsRachel Andrew
 
04 CSS #burningkeyboards
04 CSS #burningkeyboards04 CSS #burningkeyboards
04 CSS #burningkeyboardsDenis Ristic
 

Similar to Drupal theming using the 960.gs grid system (20)

Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2010)
 
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
Accelerated grid theming using NineSixty (Dallas Drupal Days 2011)
 
Accelerated grid theming using NineSixty (DrupalCamp Dallas)
Accelerated grid theming using NineSixty (DrupalCamp Dallas)Accelerated grid theming using NineSixty (DrupalCamp Dallas)
Accelerated grid theming using NineSixty (DrupalCamp Dallas)
 
Accelerated Grid Theming
Accelerated Grid ThemingAccelerated Grid Theming
Accelerated Grid Theming
 
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)
Accelerated grid theming using NineSixty (Drupal Design Camp Boston 2009)
 
MW2011 Grid-based Web Design presentation
MW2011 Grid-based Web Design presentationMW2011 Grid-based Web Design presentation
MW2011 Grid-based Web Design presentation
 
Grid system- cbil360.com
Grid system- cbil360.comGrid system- cbil360.com
Grid system- cbil360.com
 
Web I - 07 - CSS Frameworks
Web I - 07 - CSS FrameworksWeb I - 07 - CSS Frameworks
Web I - 07 - CSS Frameworks
 
DUG: Grids & Panels
DUG: Grids & PanelsDUG: Grids & Panels
DUG: Grids & Panels
 
CSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing websiteCSS3 for web designer - How to design a visually appealing website
CSS3 for web designer - How to design a visually appealing website
 
Drupal 960 grid system based theming
Drupal 960 grid system based theming Drupal 960 grid system based theming
Drupal 960 grid system based theming
 
CSS3 Layout
CSS3 LayoutCSS3 Layout
CSS3 Layout
 
The Future of CSS Layout
The Future of CSS LayoutThe Future of CSS Layout
The Future of CSS Layout
 
MySQL Schema Design in Practice
MySQL Schema Design in PracticeMySQL Schema Design in Practice
MySQL Schema Design in Practice
 
RWD
RWDRWD
RWD
 
Start Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJSStart Using CSS Grid Layout Today - RuhrJS
Start Using CSS Grid Layout Today - RuhrJS
 
New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)New layout models on the Web (Mobile World Congress 2014)
New layout models on the Web (Mobile World Congress 2014)
 
Maintainable theming
Maintainable themingMaintainable theming
Maintainable theming
 
View Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & FriendsView Source London: Solving Layout Problems with CSS Grid & Friends
View Source London: Solving Layout Problems with CSS Grid & Friends
 
04 CSS #burningkeyboards
04 CSS #burningkeyboards04 CSS #burningkeyboards
04 CSS #burningkeyboards
 

More from Four Kitchens

Four Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens
 
Four Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Four Kitchens
 
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...Four Kitchens
 
Big Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyBig Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyFour Kitchens
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screenFour Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Four Kitchens
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalFour Kitchens
 
Designing future proof websites
Designing future proof websitesDesigning future proof websites
Designing future proof websitesFour Kitchens
 
Making drupal beautiful with web fonts
Making drupal beautiful with web fontsMaking drupal beautiful with web fonts
Making drupal beautiful with web fontsFour Kitchens
 
The type revolutionary's cookbook
The type revolutionary's cookbookThe type revolutionary's cookbook
The type revolutionary's cookbookFour Kitchens
 
The Web Chef Cookbook
The Web Chef CookbookThe Web Chef Cookbook
The Web Chef CookbookFour Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)Four Kitchens
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)Four Kitchens
 

More from Four Kitchens (20)

Four Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMSFour Kitchens Presents: Future of the CMS
Four Kitchens Presents: Future of the CMS
 
Four Kitchens: We make BIG websites
Four Kitchens: We make BIG websitesFour Kitchens: We make BIG websites
Four Kitchens: We make BIG websites
 
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
Don't Design Websites. Design Web SYSTEMS! (UT Austin Drupal Users Group)
 
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...No RFPs! Why requests for proposal are bad for business (and how we can stop ...
No RFPs! Why requests for proposal are bad for business (and how we can stop ...
 
Big Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case StudyBig Websites for Small Screens: ICANN.org Case Study
Big Websites for Small Screens: ICANN.org Case Study
 
UX design for every screen
UX design for every screenUX design for every screen
UX design for every screen
 
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
Don't Design Websites. Design Web SYSTEMS! (BADCamp 2011)
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon London 2011)
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp LA 2011)
 
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
Don't Design Websites. Design Web SYSTEMS! (Dallas Drupal Days 2011)
 
Building Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with DrupalBuilding Responsive Websites and Apps with Drupal
Building Responsive Websites and Apps with Drupal
 
Intro to Drush
Intro to DrushIntro to Drush
Intro to Drush
 
Teaching Drupal
Teaching DrupalTeaching Drupal
Teaching Drupal
 
Big Websites
Big WebsitesBig Websites
Big Websites
 
Designing future proof websites
Designing future proof websitesDesigning future proof websites
Designing future proof websites
 
Making drupal beautiful with web fonts
Making drupal beautiful with web fontsMaking drupal beautiful with web fonts
Making drupal beautiful with web fonts
 
The type revolutionary's cookbook
The type revolutionary's cookbookThe type revolutionary's cookbook
The type revolutionary's cookbook
 
The Web Chef Cookbook
The Web Chef CookbookThe Web Chef Cookbook
The Web Chef Cookbook
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCamp Stockholm 2011)
 
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)
Don't Design Websites. Design Web SYSTEMS! (DrupalCon Chicago 2011)
 

Recently uploaded

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Drupal theming using the 960.gs grid system

  • 1. Drupal theming using the 960.gs grid system Originally presented at DrupalCamps Copenhagen, Helsinki, and Stockholm 2009 May, 2009 | Todd Ross Nienkerk
  • 3. Todd Ross Nienkerk ‣ Co-founder of Four Kitchens, a Drupal design and development firm in Austin, Texas ‣ One of the implementers of the new Drupal.org redesign ‣ Member of the Drupal documentation team Photo: Kristin Hillery
  • 4. What is a grid system?
  • 5. History of the grid ‣ The practice of using a grid to guide design and page layout is nearly a century old ‣ In the 1910s and 1920s, ornamental design gave way to Rationalism and New Objectivity ‣ This shift in design was part of a much larger movement towards function over form ‣ Helvetica typeface and Bauhaus architecture Source: Grids are Good by Khoi Vinh and Mark Boulton
  • 6. Typographic grids ‣ After World War II, a number of graphic designers, influenced by the modernist ideas of Die neue Typographie (The New Typography), questioned the relevance of the conventional page layout of the time ‣ They devised a flexible system to help designers achieve coherency in organizing the page Source: Grid (page layout) on Wikipedia
  • 7. The result was the modern typographic grid associated with the International Typographic Style ‣ Grid Systems in Graphic Design, the seminal work on the subject, helped propagate the use of the grid in Europe and, later, in North America Source: Grid (page layout) on Wikipedia
  • 8. Nearly a century ago ‣ Modernists looked to build a new aesthetic by... ‣ deriving beauty from the innate qualities of the machine ‣ championing standardization ‣ Sound familiar? Source: Grids are Good by Khoi Vinh and Mark Boulton
  • 9. Today ‣ Web designers have turned to grid-based design in order to... ‣ derive beauty from the innate qualities of the browser ‣ champion standardization ‣ 16 years after the invention of the web, we are finally embracing a century-old design philosophy Source: Grids are Good by Khoi Vinh and Mark Boulton
  • 10. Grid systems on the web ‣ On the web, grid systems usually take the form of CSS frameworks ‣ A framework is a “reuseable abstraction of code wrapped in a well-defined API”1 ‣ A collection of tools and shortcuts designed to minimize code and make your life easier 1 Source: Software framework on Wikipedia
  • 11. Examples of frameworks ‣ Ruby on Rails is a well-known Ruby framework ‣ jQuery is a JavaScript framework ‣ Drupal itself can be considered a web application framework ‣ Includes many APIs for working with databases, fields, and web forms
  • 12. CSS frameworks ‣ Apply the principles of software frameworks to web design ‣ They provide standardized rules and shortcuts for: ‣ browser resets ‣ typography ‣ navigation ‣ print style ‣ and...
  • 13. Layout ‣ When applied to web design, grid systems are CSS frameworks that provides standardized rules and shortcuts for building a website’s layout
  • 14. Why use a grid system?
  • 15. 1) Saves time 2) Saves money 3) Reduces frustration
  • 16. Stop reinventing the wheel ‣ Reduces the amount of CSS and markup you need to duplicate each time you start a project ‣ No need to refer to old projects to figure out how to implement layouts
  • 17. Stop fixing and start designing ‣ Shortens testing phases by providing built-in support for noncompliant browsers ‣ Minimize Internet Explorer hacks in your layout ‣ A well-tested grid system will rarely be the source of your problems
  • 18. Stop deconstructing CSS ‣ Understanding someone else’s design is much easier when a standard grid system is used
  • 19. How do grid systems work?
  • 20. Columns ‣ Grid systems are built using columns ‣ Columns are a grid system’s smallest unit of measurement ‣ Most grid systems contain 12–16 columns Example based on 960.gs (12-column)
  • 21. Column width ‣ Page regions (header, content, sidebars, etc.) are defined by column width ‣ As in: “The header is eight columns wide” Example based on 960.gs (12-column)
  • 22. Gutters (margins) ‣ Margins or padding are used to create gutters between columns ‣ These gutters provide margins between page regions Example based on 960.gs (12-column)
  • 23. Lean and versatile CSS ‣ A grid system’s CSS should: ‣ Be lean and efficient ‣ Be versatile and reusable ‣ Ensure consistent behavior across all common browsers — even IE6
  • 24. Wrapping <div> elements ‣ In fixed-width grid systems, the entire layout is wrapped inside a single <div> element ‣ <div> elements wrap the page regions and define their widths according to the number of columns they span ‣ These <div> elements may be nested to create regions within regions
  • 25. Floating <div> elements ‣ The wrapping <div> class: grid-12 elements are assigned a column width using a class: class: grid-4 grid-4 CSS class class: grid-4 ‣ Because these classes class: grid-8 also float the elements, they simply fall into class: grid-6 class: grid-6 place on the page Example based on 960.gs (12-column)
  • 26. What can grid systems look like? Examples of grid-based layouts
  • 27. Layout A: Content left, sidebar right Example based on 960.gs (12-column)
  • 28. Layout B: Content between sidebars Example based on 960.gs (12-column)
  • 29. Layout C: Content right with two left sidebars Example based on 960.gs (12-column)
  • 30. Layout D: Whatever Example based on 960.gs (12-column)
  • 31. Layout E: The Mondriaan Painting by Piet Mondriaan (later Mondrian)
  • 33. What is 960.gs? ‣ 960.gs — also known as the 960 Grid System — was created by Nathan Smith in order to “streamline web development workflow” ‣ It’s both a prototyping and development framework ‣ “The premise of the system is ideally suited to rapid prototyping, but it would work equally well when integrated into a production environment.” Source: 960.gs
  • 34. What’s in it ‣ Download it for free at http://960.gs ‣ GPL and MIT licensed ‣ The 960.gs download includes: ‣ Printable sketch sheets for doodling ‣ Design templates for all most applications: Photoshop, Illustrator, Inkscape, OmniGraffle, etc. Source: 960.gs
  • 35. Technical specs ‣ 960px wide with a 940px usable area ‣ Two versions: 12- and 16-column ‣ These can be implemented separately or simultaneously ‣ Each column has a 10px margin on the left and right, which creates a 20px gutter between columns Source: 960.gs
  • 36. 12-column version Columns are 60px wide Gutters are 20px wide 10px margin on the left and Available right prevents collision with working area browser chrome is 940px wide Source: 960.gs
  • 37. 16-column version Columns are 40px wide Everything else remains the same Source: 960.gs
  • 38. Using both versions simultaneously ‣ You can use 12-column classes inside a 16-column grid — and vice versa ‣ This is possible because 12 and 16 are both multiples of 2 and 4 ‣ 2 * 6 = 12 ‣ 4 * 3 = 12 ‣ 2 * 8 = 16 ‣ 4 * 4 = 16
  • 39. In other words, when you divide the layout into halves and quarters, you can use 12- and 16- column version simultaneously ‣ Watch what happens when you lay one grid on top of the other: Halves Quarters
  • 40. This flexibility allows designers to work with both 60px- and 40px-wide columns ‣ If 12 or 16 columns don’t suit you, 960 is also divisible by 2, 3, 4, 5, 6, 8, 10, 15, 20, 24, 30, 32, 40, 48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480
  • 41. CSS and markup Note: 960.gs uses underscores in its CSS class names. To avoid confusion, the examples that follow will use hyphens instead, as this is The Drupal Way.
  • 42. Containers ‣ Grids must be wrapped in a container <div> .container-12, .container-16 { ‣ Containers center the margin-left: auto; content and define margin-right: auto; which version of the width: 960px; } grid will be implemented
  • 43. Grids ‣ Grids are held inside .grid-1, .grid-2, containers and are .grid-3, floated left so they fall ... into place .grid-16 { display: inline; automatically float: left; position: relative; ‣ They also provide 10px margin-left: 10px; margins on the left and margin-right: 10px; } right
  • 44. Grid widths ‣ The width of each grid is determined by the .container-12 .grid-1 { container that wraps it width: 60px; } ‣ For example, a one- .container-16 .grid-1 { column grid is either width: 40px; 60px or 40px } depending on whether it’s a 12- or 16-column layout
  • 45. Note that grid width does not increase by 60px or 40px each time ‣ Each increase must account for the 20px gutter between grids .container-12 .grid-1 { .container-16 .grid-1 { width: 60px; width: 40px; } } .container-12 .grid-2 { .container-16 .grid-2 { width: 140px; width: 100px; } } .container-12 .grid-3 { .container-16 .grid-3 { width: 300px; width: 160px; } }
  • 46. Putting containers and grids together .container-12 .grid-3 .grid-6 .grid-3
  • 47. Prefixes and suffixes ‣ If you want to leave space between .container-12 .prefix-1 { columns, use a prefix padding-left: 80px; or suffix class } .container-12 .suffix-1 { ‣ Prefix classes add padding-right: 80px; padding to the left of a } column ‣ Suffix classes add padding to the right
  • 48. Adding a prefix and suffix .container-12 .grid-4 .grid-3 .prefix-1 .grid-3 .suffix-1
  • 49. Multiple rows .container-12 .grid-12 .grid-4 .grid-3 .prefix-1 .grid-3 .suffix-1
  • 50. Multiple rows: markup <div class="container-12"> The container <div> defines the layout <!-- row 1 --> <div class="grid-12"> version in use This grid occupies the full width </div> <!-- row 2 --> <div class="grid-3"> One wide No need to put </div> each row in its own <div class="grid-4 prefix-1 suffix-1"> wrapping <div> Four wide with a prefix and suffix of one each </div> <div class="grid-3"> One wide </div> </div> <!-- /container -->
  • 51. Stack content vertically with nested grids .grid-6 .container-12 .grid-6 .grid-3 .grid-3 .grid-6
  • 52. Here’s the catch: Because each grid includes a 10px left and right margin, nesting grids can break your layout .grid-6 .container-12 .grid-6 .grid-3 .grid-6 .grid-3
  • 53. Alpha and omega fix broken nesting ‣ When nesting grids, use the alpha and omega classes to remove the margins ‣ alpha removes the left margin. It’s the first nested grid. ‣ omega removes the right margin. It’s the last nested grid.
  • 54. .grid-6 .container-12 .grid-3 .grid-3 .alpha .omega .grid-3 .grid-3 .grid-6 .alpha .omega .alpha removed .omega removed the left margin the right margin
  • 55. Additional resources ‣ 960 Gridder and bookmarklet ‣ Variable grid system generator ‣ Other grid systems based on 960.gs ‣ Fluid 960.gs ‣ Typogridphy: Typographical and grid layout CSS framework ‣ and...
  • 56. The NineSixty theme Drupal’s implementation of 960.gs is even better than the original http://drupal.org/project/ninesixty
  • 57. About NineSixty ‣ NineSixty is the Drupal port of 960.gs ‣ Developed by Joon Park, aka dvessel on Drupal.org ‣ Intended to be used as a base theme ‣ Currently a candidate for Drupal 7 core ‣ Follow the debate on groups.drupal.org Source: Drupal.org
  • 58. NineSixty’s improvements ‣ Content-first layout using “push” and “pull” classes ‣ Dynamic grid widths based on context ‣ Debugging tools and grid visualization ‣ Right-to-left (RTL) language support
  • 59. Content-first layout ‣ A design convention in which the content is output as close to the top of the markup as possible ‣ Content should be output before all sidebars ‣ Some designers believe it should be output before a site’s main navigation ‣ This can be very difficult to achieve on a site with one or more left columns
  • 60. Push and pull classes ‣ Content-first layout can be achieved in NineSixty by “pushing” the content grid to the right while “pulling” a sidebar to the left ‣ These classes use the same naming convention as .grid-X, .prefix-X, and .suffix-X, where X is the grid’s width: ‣ .push-X and .pull-X
  • 61. Push and pull values should match the grid value of the opposite grid <div class="container-12"> <div id="content" class="grid-6 push-3"> Match numbers to Content swap locations </div> <div id="sidebar-left" class="grid-3 pull-6"> Sidebar: Left </div> <div id="sidebar-right" class="grid-3"> Sidebar: Right </div> </div> Source: NineSixty’s README.txt
  • 62. Before adding push and pull .container-12 .grid-6 .grid-3 .grid-3 <div class="container-12"> <div id="content" class="grid-6"> Content </div> <div id="sidebar-left" class="grid-3"> Sidebar: Left </div> <div id="sidebar-right" class="grid-3"> Sidebar: Right </div> </div>
  • 63. After adding push and pull .container-12 .grid-3 .grid-6 .grid-3 .pull-6 .push-3 <div class="container-12"> <div id="content" class="grid-6 push-3"> Content </div> <div id="sidebar-left" class="grid-3 pull-6"> Sidebar: Left </div> <div id="sidebar-right" class="grid-3"> Sidebar: Right </div> </div>
  • 64. Dynamic grid widths ‣ In some cases, you may want grids to resize themselves when a region isn’t populated ‣ For example, a 3-6-3 layout should become 3-9 if the right column is empty ‣ Dynamic width assignment is handled using the ns() function ‣ Defined in template.php
  • 65. Structure of ns() These “pairs” Default subtract from the value default value ns('class-X', $region, Y, $region, Z, ...) ‣ X, Y, and Z are all width values ‣ class can be grid, prefix, suffix, push, or pull ‣ $region can be any theme region ‣ Use as many pairs as you like
  • 66. Implementing ns() From page.tpl.php: <div id="main" class="column <?php print ns('grid-16', $left, 4, $right, 3) . ' ' . ns('push-4', !$left, 4); ?>"> <?php print $content; ?> </div> <?php if ($left): ?> <div id="sidebar-left" class="column sidebar region grid-4 <? php print ns('pull-12', $right, 3); ?>"> <?php print $left; ?> </div> <?php endif; ?> <?php if ($right): ?> <div id="sidebar-right" class="column sidebar region grid-3"> <?php print $right; ?> </div> <?php endif; ?> Source: NineSixty’s page.tpl.php
  • 67. From #main: <?php print ns('grid-16', $left, 4, $right, 3) . ' ' . ns('push-4', !$left, 4); ?> If left sidebar is If right sidebar is Default present, subtract 4 present, subtract 3 width from default width. from default width. ns('grid-16', $left, 4, $right, 3) If left sidebar is not present, subtract Default 4 from the push value. This will result push value in no push, as 4-4 = 0 ns('push-4', !$left, 4) Source: NineSixty’s page.tpl.php
  • 68. From #sidebar-left: <?php php print ns('pull-12', $right, 3); ?> If right sidebar is Default present, subtract 3 pull value from default pull value ns('pull-12', $right, 3) Source: NineSixty’s page.tpl.php
  • 69. NineSixty in action ‣ Visit http://ninesixty.fkdemos.com to see how NineSixty... ‣ uses push and pull classes to generate content- first layout ‣ dynamically assigns grid widths based on context ‣ can be used to create different layouts
  • 70. Implementing a grid- based layout Using NineSixty to build your site
  • 71. When not to use a grid ‣ Implementing a grid will probably be impossible if your site’s layout... ‣ uses irregular column sizes ‣ has irregular margins or gutters ‣ has a width that isn’t divisible by a sane number
  • 72. Implementing a grid will be difficult — but not impossible — if your site’s layout... ‣ has gutter widths of odd numbers ‣ is fluid ‣ wasn’t designed on a grid
  • 73. Getting started ‣ Do not change the NineSixty theme on your site! ‣ Hacking NineSixty is like hacking core: It will make upgrading your site very difficult ‣ Instead, subtheme NineSixty or create a totally new theme based on NineSixty
  • 74. Subtheme ‣ This method is best if your site is (or can be) 960px wide and can utilize 12 or 16 columns ‣ Subtheming instructions and resources on Drupal.org: ‣ Subtheming quick and dirty ‣ Sub-themes, their structure and inheritance
  • 75. Build a new theme ‣ You should build a new theme when your site’s layout... ‣ isn’t 960px wide ‣ doesn’t use 12 or 16 columns ‣ It’s more efficient to use a new theme than to override virtually all of NineSixty’s CSS
  • 76. Do the math ‣ Be prepared to crunch numbers ‣ Building a new theme can be very confusing ‣ Spreadsheets can help you visualize column, margins, and gutters Image source: Client project
  • 77. The grid equation (Canvas - ((Total units - 1) x Gutter)) ÷ Total units = Unit ‣ Examples (remember that the true “canvas” size of 960.gs is actually 940px): ‣ (940 - ((12 - 1) x 20)) ÷ 12 = 60 ‣ (940 - ((16 - 1) x 20)) ÷ 16 = 40 Source: Grids are Good by Khoi Vinh and Mark Boulton
  • 78. Case study Four Kitchens’ company website
  • 79. Subtheme of NineSixty ‣ 12-column version Source: fourkitchens.com
  • 81. Header promos Right column grid-4 grid-3 Content column grid-8 Gutter grid-1 Source: fourkitchens.com/blog
  • 83. Content column Gutter Right column grid-8 grid-1 grid-3 Footer columns grid-3 Sub-footer Gutter Sub-footer content column grid-1 right column grid-8 grid-3 Source: fourkitchens.com
  • 85. Learn more about grids ‣ The Grid System ‣ “The ultimate resource in grid systems” ‣ The Grid System’s Flickr pool ‣ My bookmarks tagged “gridsystems”
  • 86. Downloads ‣ 960 grid system: 960.gs ‣ NineSixty theme for Drupal: drupal.org/project/ ninesixty ‣ This and other presentations are available for download at fourkitchens.com/presentations
  • 87. Contact me ‣ Email: todd@fourkitchens.com ‣ also works for Google Chat and AIM ‣ Skype: toddatfk ‣ Twitter: twitter.com/toddross
  • 88. Credits ‣ “History of the grid” slides were ‣ This presentation was created and borrowed heavily from Khoi Vinh delivered by Todd Ross Nienkerk, and Mark Boulton’s presentation co-founder of Four Kitchens Grids are Good and from Wikipedia ‣ Piet Mondriaan painting was found somewhere online. Copyright holder is unknown ‣ The items listed above are exempt from this presentation’s Creative Commons license
  • 89. All content in this presentation, except where noted otherwise, is Creative Commons Attribution- ShareAlike 3.0 licensed and copyright 2009 Four Kitchen Studios, LLC.