SlideShare a Scribd company logo
1 of 16
Download to read offline
Mobile Drupal:
                           Drupal       :
                         Building a mobile theme


                              Drupal Camp Taipei 2011

                                 John Albin Wilkins


Saturday, July 9, 2011
Traditional way to support mobile


                         • Build a separate mobile website
                         • Detect mobile device
                         • Redirect to mobile site
                             This is really hard!

Saturday, July 9, 2011
Responsive Design

                         •   Single source of HTML
                                       HTML
                         •   Responds to different viewport sizes


                         •   First described by Ethan Marcotte’s article
                                     Ethan Marcotte

                             “Responsive Web Design”
                             http://www.alistapart.com/articles/responsive-web-
                             design

Saturday, July 9, 2011
Building a responsive mobile theme


                         • Mobile First
                         • Responsive Design
                          1. Flexible Grids
                          2. Flexible Images
                          3. CSS3 Media Queries
                             CSS3 Media Queries


Saturday, July 9, 2011
Mobile device zooming

                         •   Meta tags can control the scaling/zooming of
                             mobile devices
                                 Meta tags

                         •   More info:
                             http://davidbcalhoun.com/2010/viewport-metatag

      <meta name="viewport"
        content="width=device-width, initial-scale=1">
      <meta name="MobileOptimized" content="width">
      <meta name="HandheldFriendly" content="true">


Saturday, July 9, 2011
Flexible grids

                         • Use percentages to set grid sizes
                         •




                             .content { width: 62.5%; } // 5 grids
                             .sidebar { width: 37.5%; } // 3 grids
                         • Grid will grow/shrink with the screen size
                                                       /

                         • Target ÷ context = result
                                   ÷       =

Saturday, July 9, 2011
Flexible images

                         • Use max-width to constrain images within
                           the flexible grid.
                                max-width


                         • img, embed, iframe, object, video {
                               max-width: 100%;
                           }


Saturday, July 9, 2011
How do we target
                                     different screen sizes?

                         •   With CSS2 media types we could target different
                             classes of devices:
                                  CSS2 media types                     class:
                                    print, screen, handheld, all
                         •   With CSS3 media queries we target device
                             capabilities.
                                 CSS3 media queries
                             •   [type] and ([query])
                             •   all and (max-width: 768px)


Saturday, July 9, 2011
3 ways to query
                                    query
                 1. <link rel="stylesheet" href="wide.css" media="screen
                    and (min-width: 992px)">
                 2. @import url(wide.css) screen and (min-width:
                    992px);
                         theme.info:
                         stylesheets[screen][] = file.css
                         stylesheets[screen and (min-width: 992px)][] = file.css
                 3. @media screen and (min-width: 992px) {
                      .selector { property: value; }
                    }
Saturday, July 9, 2011
Breakpoints
                         320px — iPhone in portrait mode
                                iPhone
                         480px — iPhone in landscape mode
                                  iPhone
                         768px — iPad in portrait mode
                                  iPad
                         992px — small laptop (minus browser chrome)

                         1200px — large desktop

Saturday, July 9, 2011
Dealing with IE 6-8
                               IE6~8
                         ‣ IE8 and earlier don’t support media queries
                           IE8             media queries
                         1. They do support IE conditional comments
                                     IE conditional comments
                         2. They do support JavaScript polyfills
                                     JavaScript polyfills



Saturday, July 9, 2011
Dealing with IE 6-8
                              IE6~8
                         Conditional Stylesheets module:
                         http://drupal.org/project/conditional_styles

                         <!--[if lte IE 8]>
                         <link src="/css/layout/desktop.css">
                         <![endif]-->



Saturday, July 9, 2011
Dealing with IE 6-8
                           IE6~8

                         Scott Jehl, Filament Group
                         Respond.js

                         https://github.com/scottjehl/Respond




Saturday, July 9, 2011
Responsive Design


                         1. Flexible Grids
                         2. Flexible Images
                         3. CSS3 Media Queries
                            CSS3 Media Queries




Saturday, July 9, 2011
Zen 7.x-5.x-dev


                         http://john.albin.net/



Saturday, July 9, 2011
Related Topics
                         •   HTML5
                             http://html5doctor.com/how-to-use-html5-in-your-
                             client-work-right-now/
                         •   CSS3
                             http://www.css3.info
                         •   Progressive enhancement
                             http://www.alistapart.com/articles/
                             understandingprogressiveenhancement
                         •   JavaScript polyfills
                             http://remysharp.com/2010/10/08/what-is-a-polyfill
                         •   Front-end Performance
                             http://developer.yahoo.com/performance/rules.html
Saturday, July 9, 2011

More Related Content

Viewers also liked

[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談Drupal Taiwan
 
[DCTPE2010] Drupal & (Open/Anti) Government
[DCTPE2010] Drupal & (Open/Anti) Government[DCTPE2010] Drupal & (Open/Anti) Government
[DCTPE2010] Drupal & (Open/Anti) GovernmentDrupal Taiwan
 
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋Drupal Taiwan
 
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志Drupal Taiwan
 
[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務Drupal Taiwan
 
skinnySCAR in ArchitectuurNL 01 2017
skinnySCAR in ArchitectuurNL 01 2017skinnySCAR in ArchitectuurNL 01 2017
skinnySCAR in ArchitectuurNL 01 2017Marijn Boterman
 
交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局jiangshuai
 
Leadership Personality Types: USA vs China
Leadership Personality Types: USA vs ChinaLeadership Personality Types: USA vs China
Leadership Personality Types: USA vs ChinaStep Research
 
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2Drupal Taiwan
 
Minutes Of The Meeting For The Exhibit of SHS
Minutes Of The Meeting For The Exhibit of SHSMinutes Of The Meeting For The Exhibit of SHS
Minutes Of The Meeting For The Exhibit of SHSLu
 
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗Drupal Taiwan
 
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例Drupal Taiwan
 
[DCTPE2010] Microsoft
[DCTPE2010] Microsoft[DCTPE2010] Microsoft
[DCTPE2010] MicrosoftDrupal Taiwan
 
[DCTPE2010] Drupal 模組開發入門
[DCTPE2010] Drupal 模組開發入門[DCTPE2010] Drupal 模組開發入門
[DCTPE2010] Drupal 模組開發入門Drupal Taiwan
 
SHS Proposed Tuition and Other School Fees
SHS Proposed Tuition  and Other School FeesSHS Proposed Tuition  and Other School Fees
SHS Proposed Tuition and Other School FeesLu
 
[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介Drupal Taiwan
 

Viewers also liked (18)

[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 2. 中小型網站製作公司/工作室座談
 
[DCTPE2010] Drupal & (Open/Anti) Government
[DCTPE2010] Drupal & (Open/Anti) Government[DCTPE2010] Drupal & (Open/Anti) Government
[DCTPE2010] Drupal & (Open/Anti) Government
 
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋
[DCTPE2011] 8) 多伺服器/高效能的Drupal 主機解決方案--黃雋
 
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志
[DCTPE2011] Drupal 6 的 CCK/Views運用--黎偉志
 
[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務
 
skinnySCAR in ArchitectuurNL 01 2017
skinnySCAR in ArchitectuurNL 01 2017skinnySCAR in ArchitectuurNL 01 2017
skinnySCAR in ArchitectuurNL 01 2017
 
INNOVA
INNOVAINNOVA
INNOVA
 
交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局
 
Leadership Personality Types: USA vs China
Leadership Personality Types: USA vs ChinaLeadership Personality Types: USA vs China
Leadership Personality Types: USA vs China
 
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2
 
What is Joomla?
What is Joomla?What is Joomla?
What is Joomla?
 
Minutes Of The Meeting For The Exhibit of SHS
Minutes Of The Meeting For The Exhibit of SHSMinutes Of The Meeting For The Exhibit of SHS
Minutes Of The Meeting For The Exhibit of SHS
 
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
 
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
 
[DCTPE2010] Microsoft
[DCTPE2010] Microsoft[DCTPE2010] Microsoft
[DCTPE2010] Microsoft
 
[DCTPE2010] Drupal 模組開發入門
[DCTPE2010] Drupal 模組開發入門[DCTPE2010] Drupal 模組開發入門
[DCTPE2010] Drupal 模組開發入門
 
SHS Proposed Tuition and Other School Fees
SHS Proposed Tuition  and Other School FeesSHS Proposed Tuition  and Other School Fees
SHS Proposed Tuition and Other School Fees
 
[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介
 

Similar to [DCTPE2011] 7) Mobile Drupal(英/中雙語)

JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayWesley Hales
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignDATAVERSITY
 
Build a responsive website with drupal
Build a responsive website with drupalBuild a responsive website with drupal
Build a responsive website with drupalTechday7
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Creating Large-Scale Responsive Websites
Creating Large-Scale Responsive WebsitesCreating Large-Scale Responsive Websites
Creating Large-Scale Responsive WebsitesKeith Doyle
 
Html5 today
Html5 todayHtml5 today
Html5 todayRoy Yu
 
HTML and Responsive Design
HTML and Responsive Design HTML and Responsive Design
HTML and Responsive Design Mindy McAdams
 
Responsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawResponsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawMeet Magento Spain
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. ToolboxWojtek Zając
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksGautam Krishnan
 
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...dbarkoe
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignJulia Vi
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birdscolinbdclark
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCritical Mass
 
Designing Learning #eldc2011
Designing Learning #eldc2011Designing Learning #eldc2011
Designing Learning #eldc2011Nick Floro
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development SlidesVictor Miclovich
 
Bootstrap Tutorial
Bootstrap Tutorial Bootstrap Tutorial
Bootstrap Tutorial Luan Nguyen
 
Data Viz Barcamp, Amsterdam
Data Viz Barcamp, AmsterdamData Viz Barcamp, Amsterdam
Data Viz Barcamp, AmsterdamDan Brickley
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Tirthesh Ganatra
 

Similar to [DCTPE2011] 7) Mobile Drupal(英/中雙語) (20)

JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
 
Build a responsive website with drupal
Build a responsive website with drupalBuild a responsive website with drupal
Build a responsive website with drupal
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Jquery mobile
Jquery mobileJquery mobile
Jquery mobile
 
Creating Large-Scale Responsive Websites
Creating Large-Scale Responsive WebsitesCreating Large-Scale Responsive Websites
Creating Large-Scale Responsive Websites
 
Html5 today
Html5 todayHtml5 today
Html5 today
 
HTML and Responsive Design
HTML and Responsive Design HTML and Responsive Design
HTML and Responsive Design
 
Responsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawResponsive Web Design - Tom Robertshaw
Responsive Web Design - Tom Robertshaw
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and Tricks
 
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
Netbiscuits @ SXSW Interactive: Android ≠ Android: Lessons Creating a JS Fram...
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birds
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
 
Designing Learning #eldc2011
Designing Learning #eldc2011Designing Learning #eldc2011
Designing Learning #eldc2011
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development Slides
 
Bootstrap Tutorial
Bootstrap Tutorial Bootstrap Tutorial
Bootstrap Tutorial
 
Data Viz Barcamp, Amsterdam
Data Viz Barcamp, AmsterdamData Viz Barcamp, Amsterdam
Data Viz Barcamp, Amsterdam
 
Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)Responsive Web Design (HeadStart TechTalks)
Responsive Web Design (HeadStart TechTalks)
 

More from Drupal Taiwan

[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇
[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇
[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇Drupal Taiwan
 
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRMDrupal Taiwan
 
[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon intro[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon introDrupal Taiwan
 
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 shareDrupal Taiwan
 
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店Drupal Taiwan
 
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口Drupal Taiwan
 
[DCTPE2010] Biodiversity & Drupal
[DCTPE2010] Biodiversity & Drupal[DCTPE2010] Biodiversity & Drupal
[DCTPE2010] Biodiversity & DrupalDrupal Taiwan
 
[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實Drupal Taiwan
 

More from Drupal Taiwan (8)

[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇
[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇
[DCTPE2011] Drupal 6 的 CCK/Views運用--林振昇
 
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM
[DCTPE2011] 9) 案例分析 1. NNCF.org - Content, Commerce, CRM
 
[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon intro[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon intro
 
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
 
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店
[DCTPE2010] Drupal & 電子商務-Ubercart 實例介紹:線上書店
 
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口
[DCTPE2010] Drupal 學術應用-申請入學網路單一窗口
 
[DCTPE2010] Biodiversity & Drupal
[DCTPE2010] Biodiversity & Drupal[DCTPE2010] Biodiversity & Drupal
[DCTPE2010] Biodiversity & Drupal
 
[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實
 

Recently uploaded

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 

Recently uploaded (20)

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 

[DCTPE2011] 7) Mobile Drupal(英/中雙語)

  • 1. Mobile Drupal: Drupal : Building a mobile theme Drupal Camp Taipei 2011 John Albin Wilkins Saturday, July 9, 2011
  • 2. Traditional way to support mobile • Build a separate mobile website • Detect mobile device • Redirect to mobile site This is really hard! Saturday, July 9, 2011
  • 3. Responsive Design • Single source of HTML HTML • Responds to different viewport sizes • First described by Ethan Marcotte’s article Ethan Marcotte “Responsive Web Design” http://www.alistapart.com/articles/responsive-web- design Saturday, July 9, 2011
  • 4. Building a responsive mobile theme • Mobile First • Responsive Design 1. Flexible Grids 2. Flexible Images 3. CSS3 Media Queries CSS3 Media Queries Saturday, July 9, 2011
  • 5. Mobile device zooming • Meta tags can control the scaling/zooming of mobile devices Meta tags • More info: http://davidbcalhoun.com/2010/viewport-metatag <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="MobileOptimized" content="width"> <meta name="HandheldFriendly" content="true"> Saturday, July 9, 2011
  • 6. Flexible grids • Use percentages to set grid sizes • .content { width: 62.5%; } // 5 grids .sidebar { width: 37.5%; } // 3 grids • Grid will grow/shrink with the screen size / • Target ÷ context = result ÷ = Saturday, July 9, 2011
  • 7. Flexible images • Use max-width to constrain images within the flexible grid. max-width • img, embed, iframe, object, video { max-width: 100%; } Saturday, July 9, 2011
  • 8. How do we target different screen sizes? • With CSS2 media types we could target different classes of devices: CSS2 media types class: print, screen, handheld, all • With CSS3 media queries we target device capabilities. CSS3 media queries • [type] and ([query]) • all and (max-width: 768px) Saturday, July 9, 2011
  • 9. 3 ways to query query 1. <link rel="stylesheet" href="wide.css" media="screen and (min-width: 992px)"> 2. @import url(wide.css) screen and (min-width: 992px); theme.info: stylesheets[screen][] = file.css stylesheets[screen and (min-width: 992px)][] = file.css 3. @media screen and (min-width: 992px) { .selector { property: value; } } Saturday, July 9, 2011
  • 10. Breakpoints 320px — iPhone in portrait mode iPhone 480px — iPhone in landscape mode iPhone 768px — iPad in portrait mode iPad 992px — small laptop (minus browser chrome) 1200px — large desktop Saturday, July 9, 2011
  • 11. Dealing with IE 6-8 IE6~8 ‣ IE8 and earlier don’t support media queries IE8 media queries 1. They do support IE conditional comments IE conditional comments 2. They do support JavaScript polyfills JavaScript polyfills Saturday, July 9, 2011
  • 12. Dealing with IE 6-8 IE6~8 Conditional Stylesheets module: http://drupal.org/project/conditional_styles <!--[if lte IE 8]> <link src="/css/layout/desktop.css"> <![endif]--> Saturday, July 9, 2011
  • 13. Dealing with IE 6-8 IE6~8 Scott Jehl, Filament Group Respond.js https://github.com/scottjehl/Respond Saturday, July 9, 2011
  • 14. Responsive Design 1. Flexible Grids 2. Flexible Images 3. CSS3 Media Queries CSS3 Media Queries Saturday, July 9, 2011
  • 15. Zen 7.x-5.x-dev http://john.albin.net/ Saturday, July 9, 2011
  • 16. Related Topics • HTML5 http://html5doctor.com/how-to-use-html5-in-your- client-work-right-now/ • CSS3 http://www.css3.info • Progressive enhancement http://www.alistapart.com/articles/ understandingprogressiveenhancement • JavaScript polyfills http://remysharp.com/2010/10/08/what-is-a-polyfill • Front-end Performance http://developer.yahoo.com/performance/rules.html Saturday, July 9, 2011