SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Andere mochten auch

[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) Government
Drupal 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
 
交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局交互组读书分享——组织页面,页面元素的布局
交互组读书分享——组织页面,页面元素的布局
jiangshuai
 
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2[DCTPE2011] 11) Drupal 是好的生財工具嗎?  1. 網站標案經驗分享 x 2
[DCTPE2011] 11) Drupal 是好的生財工具嗎? 1. 網站標案經驗分享 x 2
Drupal Taiwan
 
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
[DCTPE2010] 從企劃到開發維護的 Drupal 專案經驗
Drupal Taiwan
 
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
[DCTPE2010] 多站架設商業應用與實務-以本土癮科技為例
Drupal Taiwan
 
[DCTPE2010] Microsoft
[DCTPE2010] Microsoft[DCTPE2010] Microsoft
[DCTPE2010] Microsoft
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 Fees
Lu
 
[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介[DCTPE2010] 綠界科技-網路金流機制服務簡介
[DCTPE2010] 綠界科技-網路金流機制服務簡介
Drupal Taiwan
 

Andere mochten auch (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] 綠界科技-網路金流機制服務簡介
 

Ähnlich wie [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 Today
Wesley Hales
 
Html5 today
Html5 todayHtml5 today
Html5 today
Roy Yu
 
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
 
Cm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learnCm i padwebdev_lunch_learn
Cm i padwebdev_lunch_learn
Critical Mass
 

Ähnlich wie [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)
 

Mehr von 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, CRM
Drupal Taiwan
 
[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon intro[DCTPE2011]Drupalthon intro
[DCTPE2011]Drupalthon intro
Drupal Taiwan
 
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
[DCTPE2010] Drupalcamp 商業案例:獎金獵人 share
Drupal 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 & Drupal
Drupal Taiwan
 
[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實[DCTPE2010] Open Hopen 政府網站的理想與現實
[DCTPE2010] Open Hopen 政府網站的理想與現實
Drupal Taiwan
 

Mehr von 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 政府網站的理想與現實
 

Kürzlich hochgeladen

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
Earley Information Science
 

Kürzlich hochgeladen (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer 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 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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)
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
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
 

[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