Top Banner
Drupal theming via 960.gs BY: Gaurav Mishra
26

Drupal 960 grid system based theming

Jan 28, 2015

Download

Design

Gaurav Mishra

Drupal 960 grid system based theming
Drupal Sprint 30-31 Oct 2009, Pune India

http://drupalindia2009.plug.org.in/talk/drupal-theming-960-grid-system
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Drupal 960 grid system based theming

Drupal theming via 960.gs

BY: Gaurav Mishra

Page 2: Drupal 960 grid system based theming

Introduction about 960.gs – A CSS framework

CSS frameworks are

“a set of tools, libraries, conventions, and best practices that attempt

to abstract routine tasks into generic modules that can be reused. The

goal here is to allow the designer or developer to focus on tasks that

are unique to a given project, rather than reinventing the wheel each

time around.“

-Jef Croft

Page 3: Drupal 960 grid system based theming

Benefits of CSS framework

• Make your life easier NOT HARDER

• Do not repeat yourself methodology

• Scaleable and Maintenance

• Based upon Grids

• Eg. 960.gs, Blueprint, YUI Grids

Page 4: Drupal 960 grid system based theming

Basics First - Grid-based design

• Established them in magazine and news paper industry

• Present information in structured, meaningful and visually distinct way

• Hierarchical information is cleanly represented

Page 5: Drupal 960 grid system based theming

Grid-based design

Page 6: Drupal 960 grid system based theming

Grid-based design

Page 7: Drupal 960 grid system based theming

Grid-based design

Page 8: Drupal 960 grid system based theming

What is Grid-based css framework and the WHY ?

• essentially a prebuilt set of classes which easily achieve a grid-based Layout

• Grids - 16 years after the invention of the web, we are finally embracing a century-old design philosophy That is still so POWER FULL

• well defined css files splits into organized structure based upon their FUNCTION

Page 9: Drupal 960 grid system based theming

Back to 960.Gs (by Nathan Smith)

download it from http://960.gs

• based on a width of 960 pixels.

• two variants: 12 and 16 columns

• reduce common headaches

• saves your time === money

• Handle non compliant browser with care (most beloved IE 6)

• both a prototyping and development framework

Page 10: Drupal 960 grid system based theming

960.gs grids anatomy (12 col)

• 12 column grid is divided into portions that are 60 pixels wide

• Each column is 60 px wide

Page 11: Drupal 960 grid system based theming

960.gs grids anatomy (16 col)

• The 16-column grid width is 40 px.

• Rest is same as 12-column grid

Page 12: Drupal 960 grid system based theming

How grid based layout looks like ?

Page 13: Drupal 960 grid system based theming

Layout A: Content left, sidebar right (12 col)

Page 14: Drupal 960 grid system based theming

Layout B: Content left, sidebar right

Page 15: Drupal 960 grid system based theming

Layout C: Content with two left sidebars (12 col based)

Page 16: Drupal 960 grid system based theming

Lets get REAL

• Subtraction - wordpress theme by Khoi Vinh

Page 17: Drupal 960 grid system based theming

Layout C: Content with two left sidebars (12 col based)

Page 18: Drupal 960 grid system based theming

Say Hello to smart classes

• .grid-1, .grid-2 ….grid-16 and there width depend upon top container enclosing it

that is either .container-12 or .container-16

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 19: Drupal 960 grid system based theming

Say Hello to smart classes… in progress

• alpha margin-left: 0;

• omega margin-right:0;

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 20: Drupal 960 grid system based theming

Say Hello to smart classes… in progress

• prefix class add padding to left

• suffix class add padding to right

If you want to leave space between columns, use a prefix or suffix class

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 21: Drupal 960 grid system based theming

Implementing

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 22: Drupal 960 grid system based theming

The NineSixty theme

Download from http://drupal.org/project/ninesixty

Page 23: Drupal 960 grid system based theming

The ns() function – get Speed

• X,Y and Z are width values

• $region refers to theme region

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

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 24: Drupal 960 grid system based theming

LOOking in Page.tpl.php

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 25: Drupal 960 grid system based theming

<div id=main> @page.tpl.php

Credits Screenshots - Accelerated grid theming using NineSixty (Drupal DesignCamp Boston)

Page 26: Drupal 960 grid system based theming

Question O_O pleaseZzz / Feedback

Do have fun with theming