SlideShare une entreprise Scribd logo
1  sur  35
Slides


•   Slideshare
    http://www.slideshare.net/ucbdrupal/bdug-responsive-
    webtheming20120723

•   UC Berkeley: IST Drupal
    ist-drupal@lists.berkeley.edu




                              2
Agenda

•   Introduction
•   Responsive Web Design
•   Base Theme: Zen 5
•   CSS Preprocessing
•   Sass
•   Compass
•   Zen Starterkit
•   Demo
•   Preview Berkeley Panopoly theme
•   Q&A


              3
One Website on Multiple Devices




               4
Mobile v. Babies



                   Luke Wroblewski

               “Why Mobile Matters”
                      February 2012


           “1.27M mobile devices sold or
           activated per day compared to
               371,124 children born”

           http://www.lukew.com/ff/entry.asp?1506




       5
Responsive Web Design

•   Coined by Ethan Marcotte
    http://www.alistapart.com/articles/responsive-web-design



•   Three Parts:
    1. CSS3 media queries
    2. Fluid or flexible layouts
    3. Flexible images


•   Device Independence: Users viewing your site on a
    broad range of devices will be accessing the same
    content


                                                6
What does a
    responsive website look like?

•   Online tools
    •   http://responsinator.com
    •   http://responsivepx.com
    •   http://www.netmagazine.com/features/50-fantastic-tools-
        responsive-web-design

•   Design examples
    •   http://mediaqueri.es/

•   Navigation Patterns
    •   http://bradfrostweb.com/blog/web/responsive-nav-patterns
    •   http://filamentgroup.com/lab/responsive_design_approach_
        for_navigation
                                   7
Media Queries


•   CSS2 introduced the concept of media queries

•   HTML files with separate stylesheets for screen and
    print
    <link rel="stylesheet" type="text/css" media="screen" href="screen.css">
    <link rel="stylesheet" type="text/css" media="print" href="print.css">


•   CSS stylesheets
    @media screen {
      * { font-family: sans-serif }
    }




                                       8
Media Queries


•   CSS3: W3C extended the functionality of media queries
    •    Check for particular media features like width, height, and color
    •    Tailor styles to a specific range of devices without changing the
         content itself

•   Implemented via the @import rule in CSS
    @import url(style480min.css) screen and (min-width: 480px);




•   Used in the HTML <link> media attribute
    <link rel="stylesheet" type="text/css" media="screen and (min-width: 480px)"
    href="style480min.css" />




                                           9
Media Queries


•   Or most commonly used directly in a style sheet
    (from Zen responsive-sidebars.css):

    @media all and (min-width: 480px) {
      #main {
        padding-top: 3em;
        position: relative;
      }

        #navigation {
          position: absolute;
          top: 0;
          height: 3em;
          width: 100%;
        }
    }



                                          10
Fluid or Flexible Layouts


•   Before responsive web design: Fixed, fluid, elastic?


    Fixed:            Fluid:               Elastic:

    #container {      #container {         #container {
      width: 400px;     width: 40%;          width: 25em;
    }                 }                    }

                      Adjusts to           Size elements
    Control and       user’s screen        with ems (relative
    consistency       resolution           unit based on font
                                           size)


                               11
Responsive Grids




       12
Flexible Images and Media


•   Scaling images and video in CSS is straightforward
    by setting the max-width to 100%.
    img {
         max-width: 100%;
    }



•   Performance considerations: May be taking up
    bandwidth to serve a high-resolution image to a
    device that isn’t using it
    http://blog.cloudfour.com/responsive-imgs/




                                             13
Responsive Base Themes


 •   Zen 5
     http://drupal.org/project/zen


 •   Adaptive Theme
     http://drupal.org/project/adaptivetheme


 •   Omega
     http://drupal.org/project/omega




                         14
Why Zen 5?


•   Terrific documentation

•   Clean organization

•   Best practices (http://drupal.org/project/zen)
          HTML5                         Optional IE6/7 Support
          HTML shiv                     Documentation
          Responsive Design             Swappable Layouts
          Sass/Compass                  Drush Support
          CSS                           RTL Language Support
          Zen Grids                     Accessibility
          Normalize CSS
          Respond.js
          IE Conditional Classes
                                   15
CSS Preprocessing

•   Sounds more complicated than it is
•   “I already know CSS; no time to learn something new”
•   Easy to get started
•   Just an extension of CSS – use as much or as little as desired
•   Sass (http://sass-lang.com) or Less (http://lesscss.org)
    •    Allow you to write cleaner and easier-to-read code
    •    Run through CSS preprocessor – transforms into typical CSS
    •    Can just write css, so easy to "sassify” or “lessify” existing CSS files

•   Live websites are running CSS (compiled by Sass)


                                              16
Sass


•   “Syntactically awesome style sheets”

•   Getting started:
    •   http://sass-lang.com/tutorial.html
    •   http://thesassway.com/beginner/getting-started-with-sass-and-
        compass

•   Written in Ruby; installed via Ruby package
    manager; don’t need to learn Ruby to use



                                    17
Sass


•   Mac OS X: Ruby already installed! (update if
    desired)
    ruby --version   or   ruby –v


•   Windows: Ruby installer (http://rubyinstaller.org/downloads/)

•   Linux: Install via favorite package manager

•   Install Sass:
    gem install sass


                                    18
Sass


•   Two syntaxes
    •   .sass (Sass – older syntax for those who like
        terseness; indentation instead of braces and
        semicolons)
    •   .scss (Sassy CSS – default syntax of Sass 3)


•   Default SCSS syntax is a superset of CSS
    •   Allows you to write CSS and only add SCSS when
        you need it
    •   Every CSS file is a valid SCSS file

                              19
Sass Examples
  http://sass-lang.com




           20
Sass Examples
  http://sass-lang.com




           21
Sass Examples
  http://sass-lang.com




           22
Sass Examples
  http://sass-lang.com




           23
Compass
                           http://compass-style.org




•   Open Source CSS Authoring Framework
    •   Uses Sass
    •   Makes things easier
    •   Library of functions and add-ons to do common things

•   Install Compass:
    gem install compass

•   Using Compass (outside of Zen 5, Drupal):
    compass help
    Primary Commands:
      * clean   - Remove generated files and the sass cache
      * compile - Compile Sass stylesheets to CSS
      * create - Create a new compass project
      * init    - Add compass to an existing project
      * watch   - Compile Sass stylesheets to CSS when they change

                                       24
CSS before Compass
    http://compass-style.org




               25
Compass
http://compass-style.org




           26
Compass: CSS module
     http://compass-style.org




                27
Compass: Sprites
                  http://compass-style.org/help/tutorials/spriting




 Image sprites
      •    Performance boost by fetching all images at once
      •    Difficult to create and manage

 Example: Baron Wanschers, LimoenGroen (Lime Green):
 http://www.bariswanschers.com/blog/use-sass-and-compass-streamline-your-css-development:




Generated CSS:
                                            28
Zen 5

•   Already set up to use Sass and Compass
•   STARTERKIT
    (see zen/STARTERKIT/README.txt)
    •   Copy the STARTERKIT folder, place under sites/all/themes and rename
             Copy “sites/all/themes/zen/STARTERKIT”
             To “sites/all/themes/foo”

    •   Rename “STARTERKIT.info.txt” as “foo.info” and update name and description
    •   In template.php and theme-settings.php: Replace ALL occurrences of
        "STARTERKIT" with “foo”
    •   Set default theme at admin/appearance

•   Or use drush:
    drush zen "Foo Theme" foo

                                          29
Zen 5

•   Review Files
    •     Standard Drupal theme files
    •     Standard folders
    •     Sass-related files/folders

•   Using Sass and Compass with Zen 5
    From root of your sub-theme folder:

          compass clean //removes existing css files so they can be regenerated


          compass watch //watches the “sass” directory
                         //anytime a .scss file is changed, .css auto-generated
                         //includes debug feature for syntax errors during development
                         //launch compass watch and leave running (if needed, re-launch
          terminal)
                         //can look at css generated but eventually just work with scss files
                                            30
Zen Grids
http://zengrids.com




        31
Zen 5: Production


•   When ready to move to production…
    See http://drupal.org/node/1548946 and zen/STARTERKIT/sass/README.txt

•   Update CSS files, minify, and aggregate for
    performance:
    •   compass clean
    •   edit config.rb by uncommenting “#environment = :production”
    •   turn on CSS aggregation




                                    32
Tools


•   FireSass for Firebug: https://addons.mozilla.org/en-
    US/firefox/addon/firesass-for-firebug/

•   ZenGrids:
    http://zengrids.com

•   If you don’t like the command line:
    •    Compass.app: http://compass.handlino.com/ (Mac, Linux, PC)
    •    Fire.app: http://fireapp.handlino.com/ (Mac, Linux, PC)
    •    Codekit: http://incident57.com/codekit/ (Mac)




                                     33
Berkeley Panopoly

• Berkeley Panopoly Theme
• Panopoly
  http://drupal.org/project/panopoly




                                       34
Next Steps
          Pilots

      • Administration &
        Finance
      • Office of the
        Chancellor
      • BAS: Parking &
        Transportation
      • Campus IT




35

Contenu connexe

Tendances

From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingRobert Carr
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) ThemingPINGV
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseDavid Yeiser
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinSuzanne Dergacheva
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structurekeithdevon
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingJamie Schmid
 
Developing Your Ultimate Package
Developing Your Ultimate PackageDeveloping Your Ultimate Package
Developing Your Ultimate PackageSimon Collison
 
WordPress Theme Development Basics
WordPress Theme Development BasicsWordPress Theme Development Basics
WordPress Theme Development BasicsTech Liminal
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern librariesRuss Weakley
 
Performance on a budget (European Drupal Days 2015)
Performance on a budget (European Drupal Days 2015)  Performance on a budget (European Drupal Days 2015)
Performance on a budget (European Drupal Days 2015) Eugenio Minardi
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers PerspectiveMediacurrent
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationRachel Cherry
 
Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Andrea Tarr
 

Tendances (20)

From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
Grok Drupal (7) Theming
Grok Drupal (7) ThemingGrok Drupal (7) Theming
Grok Drupal (7) Theming
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public Release
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
Developing Your Ultimate Package
Developing Your Ultimate PackageDeveloping Your Ultimate Package
Developing Your Ultimate Package
 
A look at Drupal 7 Theming
A look at Drupal 7 ThemingA look at Drupal 7 Theming
A look at Drupal 7 Theming
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
WordPress Theme Development Basics
WordPress Theme Development BasicsWordPress Theme Development Basics
WordPress Theme Development Basics
 
CSS pattern libraries
CSS pattern librariesCSS pattern libraries
CSS pattern libraries
 
Performance on a budget (European Drupal Days 2015)
Performance on a budget (European Drupal Days 2015)  Performance on a budget (European Drupal Days 2015)
Performance on a budget (European Drupal Days 2015)
 
Display Suite: A Themers Perspective
Display Suite: A Themers PerspectiveDisplay Suite: A Themers Perspective
Display Suite: A Themers Perspective
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
 
Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013Using LESS, the CSS Preprocessor: J and Beyond 2013
Using LESS, the CSS Preprocessor: J and Beyond 2013
 

En vedette

Multimedia handing in Drupal 7, done better with the Media module
Multimedia handing in Drupal 7, done better with the Media moduleMultimedia handing in Drupal 7, done better with the Media module
Multimedia handing in Drupal 7, done better with the Media moduleJacob Singh
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesNed Potter
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging ChallengesAaron Irizarry
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with DataSeth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

En vedette (7)

Multimedia handing in Drupal 7, done better with the Media module
Multimedia handing in Drupal 7, done better with the Media moduleMultimedia handing in Drupal 7, done better with the Media module
Multimedia handing in Drupal 7, done better with the Media module
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similaire à BDUG Responsive Web Theming - 7/23/12

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
 
Using Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsUsing Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsJeremy Green
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha TouchNeha Upadhyay
 
Tech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalTech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalAlfresco Software
 
The Foundations of Being Sassy in Drupal
The Foundations of Being Sassy in DrupalThe Foundations of Being Sassy in Drupal
The Foundations of Being Sassy in DrupalEllie Roepken
 
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdfBest 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdfAppdeveloper10
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101FITC
 
Produce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupalProduce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupalSTIinnsbruck
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignManjunatha D
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworksryngrn
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsMario Hernandez
 
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSS
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSSBb Tour ANZ 2017 - Workshop - Enhancing Learn CSS
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSSBlackboard APAC
 
Treeshaking your CSS
Treeshaking your CSSTreeshaking your CSS
Treeshaking your CSSJames Stone
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an OverviewMatt Weaver
 
Going Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMSGoing Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMSdotCMS
 
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsAlfresco Software
 

Similaire à BDUG Responsive Web Theming - 7/23/12 (20)

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
 
Using Sass in Your WordPress Projects
Using Sass in Your WordPress ProjectsUsing Sass in Your WordPress Projects
Using Sass in Your WordPress Projects
 
Beautifying senc
Beautifying sencBeautifying senc
Beautifying senc
 
Beautifying Sencha Touch
Beautifying Sencha TouchBeautifying Sencha Touch
Beautifying Sencha Touch
 
Tech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupalTech talk-live-alfresco-drupal
Tech talk-live-alfresco-drupal
 
The Foundations of Being Sassy in Drupal
The Foundations of Being Sassy in DrupalThe Foundations of Being Sassy in Drupal
The Foundations of Being Sassy in Drupal
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdfBest 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
Best 5 CSS Frameworks You Should Know To Design Attractive Websites .pdf
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101
 
Bootstrap [part 1]
Bootstrap [part 1]Bootstrap [part 1]
Bootstrap [part 1]
 
Produce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupalProduce and consume_linked_data_with_drupal
Produce and consume_linked_data_with_drupal
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
Child Theme Frameworks
Child Theme FrameworksChild Theme Frameworks
Child Theme Frameworks
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive Enhacements
 
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSS
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSSBb Tour ANZ 2017 - Workshop - Enhancing Learn CSS
Bb Tour ANZ 2017 - Workshop - Enhancing Learn CSS
 
Treeshaking your CSS
Treeshaking your CSSTreeshaking your CSS
Treeshaking your CSS
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Going Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMSGoing Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMS
 
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

BDUG Responsive Web Theming - 7/23/12

  • 1.
  • 2. Slides • Slideshare http://www.slideshare.net/ucbdrupal/bdug-responsive- webtheming20120723 • UC Berkeley: IST Drupal ist-drupal@lists.berkeley.edu 2
  • 3. Agenda • Introduction • Responsive Web Design • Base Theme: Zen 5 • CSS Preprocessing • Sass • Compass • Zen Starterkit • Demo • Preview Berkeley Panopoly theme • Q&A 3
  • 4. One Website on Multiple Devices 4
  • 5. Mobile v. Babies Luke Wroblewski “Why Mobile Matters” February 2012 “1.27M mobile devices sold or activated per day compared to 371,124 children born” http://www.lukew.com/ff/entry.asp?1506 5
  • 6. Responsive Web Design • Coined by Ethan Marcotte http://www.alistapart.com/articles/responsive-web-design • Three Parts: 1. CSS3 media queries 2. Fluid or flexible layouts 3. Flexible images • Device Independence: Users viewing your site on a broad range of devices will be accessing the same content 6
  • 7. What does a responsive website look like? • Online tools • http://responsinator.com • http://responsivepx.com • http://www.netmagazine.com/features/50-fantastic-tools- responsive-web-design • Design examples • http://mediaqueri.es/ • Navigation Patterns • http://bradfrostweb.com/blog/web/responsive-nav-patterns • http://filamentgroup.com/lab/responsive_design_approach_ for_navigation 7
  • 8. Media Queries • CSS2 introduced the concept of media queries • HTML files with separate stylesheets for screen and print <link rel="stylesheet" type="text/css" media="screen" href="screen.css"> <link rel="stylesheet" type="text/css" media="print" href="print.css"> • CSS stylesheets @media screen { * { font-family: sans-serif } } 8
  • 9. Media Queries • CSS3: W3C extended the functionality of media queries • Check for particular media features like width, height, and color • Tailor styles to a specific range of devices without changing the content itself • Implemented via the @import rule in CSS @import url(style480min.css) screen and (min-width: 480px); • Used in the HTML <link> media attribute <link rel="stylesheet" type="text/css" media="screen and (min-width: 480px)" href="style480min.css" /> 9
  • 10. Media Queries • Or most commonly used directly in a style sheet (from Zen responsive-sidebars.css): @media all and (min-width: 480px) { #main { padding-top: 3em; position: relative; } #navigation { position: absolute; top: 0; height: 3em; width: 100%; } } 10
  • 11. Fluid or Flexible Layouts • Before responsive web design: Fixed, fluid, elastic? Fixed: Fluid: Elastic: #container { #container { #container { width: 400px; width: 40%; width: 25em; } } } Adjusts to Size elements Control and user’s screen with ems (relative consistency resolution unit based on font size) 11
  • 13. Flexible Images and Media • Scaling images and video in CSS is straightforward by setting the max-width to 100%. img { max-width: 100%; } • Performance considerations: May be taking up bandwidth to serve a high-resolution image to a device that isn’t using it http://blog.cloudfour.com/responsive-imgs/ 13
  • 14. Responsive Base Themes • Zen 5 http://drupal.org/project/zen • Adaptive Theme http://drupal.org/project/adaptivetheme • Omega http://drupal.org/project/omega 14
  • 15. Why Zen 5? • Terrific documentation • Clean organization • Best practices (http://drupal.org/project/zen) HTML5 Optional IE6/7 Support HTML shiv Documentation Responsive Design Swappable Layouts Sass/Compass Drush Support CSS RTL Language Support Zen Grids Accessibility Normalize CSS Respond.js IE Conditional Classes 15
  • 16. CSS Preprocessing • Sounds more complicated than it is • “I already know CSS; no time to learn something new” • Easy to get started • Just an extension of CSS – use as much or as little as desired • Sass (http://sass-lang.com) or Less (http://lesscss.org) • Allow you to write cleaner and easier-to-read code • Run through CSS preprocessor – transforms into typical CSS • Can just write css, so easy to "sassify” or “lessify” existing CSS files • Live websites are running CSS (compiled by Sass) 16
  • 17. Sass • “Syntactically awesome style sheets” • Getting started: • http://sass-lang.com/tutorial.html • http://thesassway.com/beginner/getting-started-with-sass-and- compass • Written in Ruby; installed via Ruby package manager; don’t need to learn Ruby to use 17
  • 18. Sass • Mac OS X: Ruby already installed! (update if desired) ruby --version or ruby –v • Windows: Ruby installer (http://rubyinstaller.org/downloads/) • Linux: Install via favorite package manager • Install Sass: gem install sass 18
  • 19. Sass • Two syntaxes • .sass (Sass – older syntax for those who like terseness; indentation instead of braces and semicolons) • .scss (Sassy CSS – default syntax of Sass 3) • Default SCSS syntax is a superset of CSS • Allows you to write CSS and only add SCSS when you need it • Every CSS file is a valid SCSS file 19
  • 20. Sass Examples http://sass-lang.com 20
  • 21. Sass Examples http://sass-lang.com 21
  • 22. Sass Examples http://sass-lang.com 22
  • 23. Sass Examples http://sass-lang.com 23
  • 24. Compass http://compass-style.org • Open Source CSS Authoring Framework • Uses Sass • Makes things easier • Library of functions and add-ons to do common things • Install Compass: gem install compass • Using Compass (outside of Zen 5, Drupal): compass help Primary Commands: * clean - Remove generated files and the sass cache * compile - Compile Sass stylesheets to CSS * create - Create a new compass project * init - Add compass to an existing project * watch - Compile Sass stylesheets to CSS when they change 24
  • 25. CSS before Compass http://compass-style.org 25
  • 27. Compass: CSS module http://compass-style.org 27
  • 28. Compass: Sprites http://compass-style.org/help/tutorials/spriting Image sprites • Performance boost by fetching all images at once • Difficult to create and manage Example: Baron Wanschers, LimoenGroen (Lime Green): http://www.bariswanschers.com/blog/use-sass-and-compass-streamline-your-css-development: Generated CSS: 28
  • 29. Zen 5 • Already set up to use Sass and Compass • STARTERKIT (see zen/STARTERKIT/README.txt) • Copy the STARTERKIT folder, place under sites/all/themes and rename Copy “sites/all/themes/zen/STARTERKIT” To “sites/all/themes/foo” • Rename “STARTERKIT.info.txt” as “foo.info” and update name and description • In template.php and theme-settings.php: Replace ALL occurrences of "STARTERKIT" with “foo” • Set default theme at admin/appearance • Or use drush: drush zen "Foo Theme" foo 29
  • 30. Zen 5 • Review Files • Standard Drupal theme files • Standard folders • Sass-related files/folders • Using Sass and Compass with Zen 5 From root of your sub-theme folder: compass clean //removes existing css files so they can be regenerated compass watch //watches the “sass” directory //anytime a .scss file is changed, .css auto-generated //includes debug feature for syntax errors during development //launch compass watch and leave running (if needed, re-launch terminal) //can look at css generated but eventually just work with scss files 30
  • 32. Zen 5: Production • When ready to move to production… See http://drupal.org/node/1548946 and zen/STARTERKIT/sass/README.txt • Update CSS files, minify, and aggregate for performance: • compass clean • edit config.rb by uncommenting “#environment = :production” • turn on CSS aggregation 32
  • 33. Tools • FireSass for Firebug: https://addons.mozilla.org/en- US/firefox/addon/firesass-for-firebug/ • ZenGrids: http://zengrids.com • If you don’t like the command line: • Compass.app: http://compass.handlino.com/ (Mac, Linux, PC) • Fire.app: http://fireapp.handlino.com/ (Mac, Linux, PC) • Codekit: http://incident57.com/codekit/ (Mac) 33
  • 34. Berkeley Panopoly • Berkeley Panopoly Theme • Panopoly http://drupal.org/project/panopoly 34
  • 35. Next Steps Pilots • Administration & Finance • Office of the Chancellor • BAS: Parking & Transportation • Campus IT 35

Notes de l'éditeur

  1. Image:http://almaer.com/blog/uploads/devices.png
  2. Image: http://mikeschuerman.theworldrace.org/blogphotos/theworldrace/mikeschuerman/cross-roads.jpg