(1) The document discusses responsive design using CSS3 media queries and the Less Framework 4.0. (2) It provides an overview of how to use Less Framework to create responsive designs for different screen sizes like desktop, tablet, mobile, and wide mobile. (3) The document also shows how to implement responsive design principles in Drupal by using Less Framework CSS styles and adjusting the theme template.
14. Responsive design
= CSS3 media queries
/* Default CSS */
#page { width:1060px; }
@media only screen and (min-width: 480px) and (max-width: 767px) {
/* CSS for this particular view-port */
#page { width:436px }
}
15. No support in IE6, IE7, IE8 (as usual)
http://www.smashingmagazine.com/2010/02/11/the-life-times-and-death-of-
internet-explorer-6-comic-strip/
16. Supported by IE9 – yeay!
http://www.smashingmagazine.com/the-smashing-cartoons/
17. Browsers without support for CSS3
and media queries get served the
default version of the site, just as they did
before implementing the framework.
30. steppenwolf.info
name = Steppenwolf
description = Steppenwolf Less Framwork 4.0 Demo Theme by Popolo
version = VERSION
core = 7.x
; Stylesheets
stylesheets[all][] = css/less-framework.css The LESS framework
stylesheets[screen][] = css/style.css The default style
stylesheets[screen][] = css/responsive.css The ”responsiveness” goes here
; Regions
regions[header] = Header
regions[searchbar] = Search bar
regions[highlighted] = Highlighted
regions[help] = Help
regions[content] = Content
regions[sidebar] = Sidebar
regions[footer_left] = Footer left
regions[footer_right] = Footer right
31. NO HTML5 in this example – sorry
<article>
<header>
<h1>Why Hello</h1>
</header>
<section>
<p></p>
</section>
<section>
<p></p>
<p></p>
<ul></ul>
</section>
</article>
32. Steppenwolf page.tpl.php
Structure of page.tpl.php
header-wrapper
unimited width header – fixed width
main – fixed width
main-wrapper content sidebar
unlimited width
footer-wrapper
footer – fixed width
unlimited width
fixed width for unlimited width
LESS FRAMEWORK for background color
37. Play around with it...
Drupal.org, download Steppenwolf: http://drupal.org/sandbox/
leanderlindahl/1306334
Slideshare: slideshare.net/leanderlindahl
This is me. I&#x2019;m Leander Lindahl from Malm&#xF6;. I&#x2019;m a designer and I have a history of working both with traditional print design and web. And I&#x2019;ve been into the whole Drupal thingy for about two years, and let me tell you... it can be frightening at first for a designer. But it is well worth the effort...\n
Less Framework for responsive design is not LESS CSS\n
Less Framework for responsive design is not LESS CSS\n
Less Framework for responsive design is not LESS CSS\n
Less Framework for responsive design is not LESS CSS\n
This is what we&#x2019;re goin to look at and hopefully learn something about\n
So what is Responsive Design all about? \n
The &#x201D;legendary&#x201D; article by Ethan Marcotte that coined the expression. The &#x201D;thing&#x201D; with responsive design is that now with CSS3 and media queries you can style your content according to the view port the user is accessing the content widh.\n
This is not a new idea. But this time around it doesn&#x2019;t suck.\nAs far as fixed-width goes, I prefer it. Look at A List Apart &#x2013; a site done by pros for other web designers. They use fixed width. It just makes sense to me, as you wouldn&#x2019;t encounter a physical newspaper made out of spandex.\nPeople are used to reading their text at a set width. It wasn&#x2019;t until the advent of the web browser that this became an issue. And, let&#x2019;s not forget that the original measurement of the web was pixels, and not percentage. Nathan Smith\nOctober 5, 2005\nhttp://www.churchmarketingsucks.com/2005/10/top-10-web-design-mistakes/\n
In reality Responsive design is about media queries (CSS3). These allow you to control which layout (CSS) get&#x2019;s used by which view port.\n
This is what media queries are...\n
IE wohoo!\n
IE9 shaped up\n
\n
\n
\n
The &#x201D;full width&#x201D; defautl layout with 10 columns. I slightly deviated from the grid for the &#x201D;image gallery&#x201D;, because I wanted three equal columns for image gallery and blog. \n
The tablet 8 column &#x201D;grid&#x201D;\n
Mobile layout, only two columns\n
Wide mobile laoyt with 5 columns\n
So these are the various layouts, all CSS-based variations\n
So how can we use this with drupal\n
Activate/ deactivate responsive.css\n
In most examples of LESS you&#x2019;ll find that they are neatly based on the new HTML5 structure, we won&#x2019;t quite get there today. We&#x2019;re using basic drupal templates...\n
This is the basic structure. The wrappers are simply to make a continuous &#x201D;unlimited width&#x201D; horisontal background. The header, main and footer are the divs that we apply the different view ports fixed width to.\n
The basic layout is done like this. We assign the grid width of 896 plus padding (48px) to the #header, #main and #footer. We subdivide the &#x201D;columns&#x201D; of #content area and #sidebar following the suggested column widths from the grid template\n
The tablet layout is done much in the same way as the default layout, but with encapsuled in a media query condition min-width:712px, max-width: 991px;\nWe adjust the columns #content and #sidebar in the #main div\n
The mobile layout, yet again, follows the same pattern. They main effort is really deciding in the design process, how to use the varying view ports. If you prepare your thinking about the visual design and interaction well, then the coding shouldn&#x2019;t be all too hard. \nThis time media queri condition is max-width: 767px;\nWe adjust the columns #content and #sidebar in the #main div\n
The wide mobile layout&#x2026; \nThis time media query condition is min-width: 480px, max-width: 767px; That means that below 480 px width we get \nWe adjust the columns #content and #sidebar in the #main div\n
Try it out for yourself! Drupal can be difficult to create example themes for because to creat anything at all you generally need some vews and som blocks. Hence I included the database with the theme. Install, try it, throw it away and apply the concept to your own designs...\n