Losing 80% of your screen space forces you to focus.
You need to know what matters most. In order to do that you need to really know your customers and your business. Which is good design 101.
-Luke Wroblewski, author of Mobile First
Different set of code for different devices
ie. m.instructables.com, mobile.nytimes.com
This is not what we are doing.
vs
Same set of code for all devices
image via metamonks.com/mobile-first-vs-responsive
Graceful Degredation
Progressive Enhancement
Liquid / Fluid Width (%)
Specific Layouts at Specific Breakpoints. Fixed Width (px)
GIF via CSS Tricks: "The Difference Between Responsive and Adaptive Design"
image via stackoverflow
<meta name="viewport" content="width=device-width, initial-scale=1.0">
read more at w3schools
Separate Stylesheets
<!-- CSS media query on a link element -->
<link rel="stylesheet" media="(max-width: 800px)" href="small.css" />
<link rel="stylesheet" media="(min-width: 801px)" href="big.css" />
For a set of Style Declarations
<!-- CSS media query within a stylesheet -->
@media (max-width: 600px) {
.sidebar {
width: 0%;
}
.show-sidebar:hover .sidebar {
width: 100%;
}
}
media types and media features
More @ Mozilla
media_type: all | aural | braille | handheld | print |
projection | screen | tty | tv | embossed
<!-- a few examples -->
media_feature: width | min-width | max-width
| height | min-height | max-height
orientation: landscape | portrait
logic: and , not only
case insensitive, but conventionally lower case
More @ Mozilla
handheld and (min-width: 20em), screen and (min-width: 20em)
The Traditional Way: Device-Specific Breakpoints
The New Trend: Mobile First.
Design for the smallest screen first.
Increase the width.
When it looks bad, make it look good with a media query.
Layout Patterns by Luke W
Responsive Patterns by Pete LePage / Google
Complex Patterns by Brad Frost
Collection of Example Links / Code by Brad Frost
*many of these use JavaScript and Frameworks that we have not covered yet.
with JavaScript