SlideShare a Scribd company logo
1 of 49
Download to read offline
FUTURE-PROOF RWD
ADAM CHAMBERS
Senior Developer, Digital Surgeons
!

@chambaz
digitalsurgeons.com
FUTURE-PROOF RWD
FUTURE-PROOF RWD
Desktop
Tablet
Mobile
THE
INTERNET
OF THINGS
Future-proofing Responsive Web Designs.
• Elastic layouts
• Mobile first
• Progressive enhancement
• Modular & semantic
• Lightweight & performant
Bourbon & Neat
Keep it relative
Elastic Layouts.
• Rems

Font sizes

• Ems

Structure, widths, heights, margins, padding

•%

Structure, widths, heights, margins, padding

• Px

Sprites, borders, rounded corners
What is an em?
“One em is equal to the computed
value of the ‘font-size’ property of
the element on which it is used”
What is an em?
body { font-size: 100%; }	

body header { font-size: 2em; }	

1em = 16px

1em = 32px

2em = 32px

2em = 64px
Elastic Layouts.
• Rems

Font sizes

• Ems

Structure, widths, heights, margins, padding

•%

Structure, widths, heights, margins, padding

• Px

Sprites, borders, rounded corners
Why not px?
Why ems?
Absolute Typography.
Base font size 16px

Base font size 40px
Relative Typography.
Base font size 16px

Base font size 40px
Absolute / Relative Media Queries.
Px base media query

Em based media query
Start small
Mobile first.
• Often referred to by the misleading term “mobile first”
• It’s really just common sense to start small and work up
• Mobile browsing is fast overtaking desktop browsing
• Forces focus by embracing the constraints of smaller devices
• Lets call it “content first”
Min-width Media Queries.
Max-width

Min-width

.responsive-element {	
	
padding: 0;	
	
@include span-columns(6);	

.responsive-element {	
	
padding: 1em;	
	
width: 100%;	
	
	
	
@include media(min-width: 48em) {	
	
	
padding: 0;	
	
	
@include span-columns(6);	
	
}	
}

!

	
	
	
	
}

@include media(max-width: 48em) {	
	
padding: 1em;	
	
width: 100%;	
}
From the ground up
Progressive Enhancement.
• Progressively enhance rather than gracefully degrading
• Starting simple and adding complexity causes far less headaches
• Load your advanced features when supported
• Just like our layouts, our functionality can grow and not shrink
• Lets call it “content first”
Progressive Enhancement.
Cutting the mustard

Progressive Enhancement

// cutting the mustard	
if(‘querySelector’ in document &&	
‘localStorage’ in window &&	
‘addEventListener’ in window) {	

if(Modernizr.webp) {	
	
// use webp images	
} else if(Modernizr.svg) {	
	
// ok use sag then	
}	

!

	
}

// all the things	

!

if(Modernizr.geolocation) {	
	
// geolocation wizardry	
}	
!

if(window.matchMedia(‘min-width: 48em’).matches) {	
	
// all the things	
}
<!––

ResponsiveComments.com ––>
Modular & meaningful
Sassy Modularity.
• I’m sure we all agree that modularity is essential
• Maintainability is essential in future proof applications
• Placeholders are invisible, reusable blocks of CSS
• Extend placeholders into classes for performant modularity
• Sass allows us to create semantic, content driven classes
Modular CSS.
HTML

CSS
.product {	
	
width: 25%;	
	
padding: 2em;	
	
float: left;	
}

.featured {	
	
width: red;	
}

<div class=“product”>	
	
<!-— product markup —->	
</div>	
!

<div class=“product featured”>	
	
<!-— featured product markup —->	
</div>
Modular Sass.
SCSS
%product {	
	
width: 25%;	
	
padding: 2em;	
	
float: left;	
}	
!

%featured {	
	
background: red;	
}

HTML
.product {	
	
@extend %product;	
}	

<div class=“product”>	
	
<!-— product markup —->	
</div>	

!

!

.featured-product {	
	
@extend %product;	
	
@extend %featured;	
}

<div class=“featured-product”>	
	
<!-— featured product markup —->	
</div>
Modular Sass.
SCSS

CSS

%title {	
	
text-transform: uppercase;	
	
line-height: 3;	
	
color: #000;	
}	

.product-title,	
.cart-title {	
	
text-transform: uppercase;	
	
line-height: 3;	
	
color: #000;	
}	

!

.product-title {	
	
margin: 20px 0;	
	
@extend %title;	
}	

!

!

!

.cart-title {	
	
float: right;	
	
@extend %title;	
}

.cart-title {	
	
float: right;	
}

.product-title {	
	
margin: 20px 0;	
}
Light & fast
Monolithic Frameworks.
• Frameworks are essential for rapid development
• Providing building blocks for your application
• Large overhead and code bloat
• Pick and choose exactly what you require
Mixins.
• Mixins are invisible, reusable blocks of CSS
• Arguments and conditional logic
• Mixin libraries have no overhead
• Only use exactly what you require
Mixin Libraries.
.product {	
	 @include span-columns(4);	
}	
!

%outer-container {	
	 @include outer-container();	
}	
!

.product-container {	
	 @extend %outer-container;	
}

@mixin btn($color) {	
	 @extend %btn;	
	 background-color: $color;	
}	
!

.product-btn {	
	 @include btn(#c0392b);	
}	
!

.delete-btn {	
	 @include btn(#d54445);	
}
jQuery.
• jQuery is a fantastic library for cross browser development
• Do you really need the entire 100kb?
• Not just page weight but call stack size
• Native JavaScript support is actually pretty good
Vanilla JS.
var products = document.querySelectorAll(‘.product’);	
!

var featuredProduct = document.querySelector(‘.featured-product’);	
!

[].forEach.call(products, function(product) {	
	 // do something with each product	
});	
!

featuredProduct.classList.add(‘active’);	
featuredProduct.classList.remove(‘active’);	
featuredProduct.classList.contains(‘active’);
Bower.
• Dependency management for the front end
• Micro-libraries over monolithic frameworks
• Small libraries that serve a single purpose
• Pick and choose exactly what you require
Bower.json
{	
"name": "Digital Surgeons",	
"version": "1.0.0",	
"private": true,	
"dependencies": {	
"normalize-scss": "~2.1.3",	
"responsive-comments": "~1.2.1",	
"html5-polyfills": "*",	
"matchmedia": "~0.1.0",	
"headroom.js": "~0.3.9",	
"raf.js": "~0.0.3",	
"respond": "~1.4.2",	
"html5shiv": "~3.7.0",	
"slider": "https://github.com/cferdinandi/slider.git",	
"swiper": "~2.4.3",	
"move.js": "https://github.com/visionmedia/move.js.git#~0.3.3",	
"imagesloaded": "~3.1.4"	
}	
}
Grunt.
• Task runner and build processes for the front end
• Package your front end code for production
• Compile, minify, concatenate, optimise
• If at all possible, automate it
Gruntfile.js
files: {	
	
// global JS	
	
‘js/dist/global.js’: [	
	
	
‘bower_components/raf.js/raf.min.js’,	
	
	
‘bower_components/html5-polyfills/classList.js’,	
	
	
‘bower_components/responsive-comments/responsive-comments.js’,	
	
	
‘bower_components/anim/anim.min.js’,	
	
	
‘bower_components/headroom.js/dist/headroom.js’,	
	
	
‘js/src/global.js’	
	
],	
	
// global JS + page specific	
	
‘js/dist/home.js’: [	
	
	
‘bower_components/swiper/dist/idangerous.swiper.js’,	
	
	
‘bower_components/eventEmitter/EventEmitter.min.js’,	
	
	
‘bower_components/eventie/eventie.js’,	
	
	
‘bower_components/imagesloaded/imagesloaded.js’,	
	
	
‘js/dist/global.js’,	
	
	
‘js/src/slider.js’,	
	
	
‘js/src/home.js’	
	
]	
}

watch: {	
	
scripts: {	
	
files: [‘js/src/*.js’],	
	
tasks: [‘uglify’],	
	
options: {	
	
	
spawn: false,	
	 livereload: true	
	
}	
	
},	
css: {	
	
files: ‘sass/*.scss’,	
	
tasks: [‘sass’],	
	
options: {	
	
	
livereload: true,	
	
}	
}	
}
#perfmatters.
• Performance is no longer just load time, it’s a feature
• Rendering performance is essential in a world of client side apps
• Use Chrome’s extensive Dev Tools to profile and optimise
• Make your application run fast and smoothly over time
Rendering Performance.
Painting Performance.
Future-proofing Responsive Web Designs.
• Elastic layouts
• Mobile first
• Progressive enhancement
• Modular & semantic
• Lightweight & performant
“Amazing last quote
with something meaningful
and memorable.”
#perfmatters
FUTURE-PROOF RWD
Follow me @chambaz
digitalsurgeons.com

More Related Content

What's hot

Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web DesignDebra Shapiro
 
Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Dave Balmer
 
Famo.us introduction
Famo.us introductionFamo.us introduction
Famo.us introductionAllen Wu
 
CSS Generator Tools
CSS Generator ToolsCSS Generator Tools
CSS Generator Toolslillianabe
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksGautam Krishnan
 
Web Building Blocks
Web Building BlocksWeb Building Blocks
Web Building Blocksjoegilbert
 
Responsive web design
Responsive web designResponsive web design
Responsive web designSean Wolfe
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) Sara Soueidan
 
CSS架構如何加速功能開發
CSS架構如何加速功能開發CSS架構如何加速功能開發
CSS架構如何加速功能開發Oliver Lin
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksNathan Smith
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDoris Chen
 
To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014James Bonham
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Pascal Rettig
 
Thinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS LayoutsThinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS Layoutsdjesse
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018Val Head
 
새로운 웹 스타일링, 안 본 사람 없게 해주세요
새로운 웹 스타일링, 안 본 사람 없게 해주세요새로운 웹 스타일링, 안 본 사람 없게 해주세요
새로운 웹 스타일링, 안 본 사람 없게 해주세요NAVER Engineering
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015Rob Davarnia
 

What's hot (20)

Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
 
The WordPress Way
The WordPress WayThe WordPress Way
The WordPress Way
 
Rockstar Graphics with HTML5
Rockstar Graphics with HTML5Rockstar Graphics with HTML5
Rockstar Graphics with HTML5
 
Famo.us introduction
Famo.us introductionFamo.us introduction
Famo.us introduction
 
CSS Generator Tools
CSS Generator ToolsCSS Generator Tools
CSS Generator Tools
 
Responsive Web Design: Tips and Tricks
Responsive Web Design: Tips and TricksResponsive Web Design: Tips and Tricks
Responsive Web Design: Tips and Tricks
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Web Building Blocks
Web Building BlocksWeb Building Blocks
Web Building Blocks
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers)
 
CSS架構如何加速功能開發
CSS架構如何加速功能開發CSS架構如何加速功能開發
CSS架構如何加速功能開發
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
Dive into HTML5: SVG and Canvas
Dive into HTML5: SVG and CanvasDive into HTML5: SVG and Canvas
Dive into HTML5: SVG and Canvas
 
To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014To build a WordPress Theme: Wordcamp Denmark 2014
To build a WordPress Theme: Wordcamp Denmark 2014
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
Thinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS LayoutsThinkin' Tags - Rapid Prototyping of CSS Layouts
Thinkin' Tags - Rapid Prototyping of CSS Layouts
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018
 
새로운 웹 스타일링, 안 본 사람 없게 해주세요
새로운 웹 스타일링, 안 본 사람 없게 해주세요새로운 웹 스타일링, 안 본 사람 없게 해주세요
새로운 웹 스타일링, 안 본 사람 없게 해주세요
 
Bootstrap Workout 2015
Bootstrap Workout 2015Bootstrap Workout 2015
Bootstrap Workout 2015
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 

Viewers also liked

Innovation in the Cloud - Rackspace Zurich Event
Innovation in the Cloud - Rackspace Zurich EventInnovation in the Cloud - Rackspace Zurich Event
Innovation in the Cloud - Rackspace Zurich EventMarc Cluet
 
Scalable, good, cheap
Scalable, good, cheapScalable, good, cheap
Scalable, good, cheapMarc Cluet
 
Service discovery and puppet
Service discovery and puppetService discovery and puppet
Service discovery and puppetMarc Cluet
 
Networking & dns 101
Networking & dns 101Networking & dns 101
Networking & dns 101Marc Cluet
 
Introduction to DevOps - Rackspace tech night
Introduction to DevOps - Rackspace tech nightIntroduction to DevOps - Rackspace tech night
Introduction to DevOps - Rackspace tech nightMarc Cluet
 
Continous delivery at docker age
Continous delivery at docker ageContinous delivery at docker age
Continous delivery at docker ageAdrien Blind
 
Typescript 102 angular and type script
Typescript 102   angular and type scriptTypescript 102   angular and type script
Typescript 102 angular and type scriptBob German
 
Typescript 101 introduction
Typescript 101   introductionTypescript 101   introduction
Typescript 101 introductionBob German
 

Viewers also liked (9)

Innovation in the Cloud - Rackspace Zurich Event
Innovation in the Cloud - Rackspace Zurich EventInnovation in the Cloud - Rackspace Zurich Event
Innovation in the Cloud - Rackspace Zurich Event
 
Scalable, good, cheap
Scalable, good, cheapScalable, good, cheap
Scalable, good, cheap
 
Google Maps Course
Google Maps CourseGoogle Maps Course
Google Maps Course
 
Service discovery and puppet
Service discovery and puppetService discovery and puppet
Service discovery and puppet
 
Networking & dns 101
Networking & dns 101Networking & dns 101
Networking & dns 101
 
Introduction to DevOps - Rackspace tech night
Introduction to DevOps - Rackspace tech nightIntroduction to DevOps - Rackspace tech night
Introduction to DevOps - Rackspace tech night
 
Continous delivery at docker age
Continous delivery at docker ageContinous delivery at docker age
Continous delivery at docker age
 
Typescript 102 angular and type script
Typescript 102   angular and type scriptTypescript 102   angular and type script
Typescript 102 angular and type script
 
Typescript 101 introduction
Typescript 101   introductionTypescript 101   introduction
Typescript 101 introduction
 

Similar to Future proof rwd

Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...Yandex
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesVitaly Friedman
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
Xamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupXamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupSeamgen
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scalescottjehl
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인Daum DNA
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bendRaj Lal
 
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewDiacode
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Chris Love
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX DesignersAshlimarie
 
WEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxWEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxsilvers5
 

Similar to Future proof rwd (20)

Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin..."Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
"Responsive Web Design: Clever Tips and Techniques". Vitaly Friedman, Smashin...
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Volunteer.rb
Volunteer.rbVolunteer.rb
Volunteer.rb
 
Xamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego MeetupXamarin 9/10 San Diego Meetup
Xamarin 9/10 San Diego Meetup
 
Responsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at ScaleResponsive & Responsible: Implementing Responsive Design at Scale
Responsive & Responsible: Implementing Responsive Design at Scale
 
Devon 2011-f-1 반응형 웹 디자인
Devon 2011-f-1  반응형 웹 디자인Devon 2011-f-1  반응형 웹 디자인
Devon 2011-f-1 반응형 웹 디자인
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bend
 
Front-End Frameworks: a quick overview
Front-End Frameworks: a quick overviewFront-End Frameworks: a quick overview
Front-End Frameworks: a quick overview
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 
HTML5: Introduction
HTML5: IntroductionHTML5: Introduction
HTML5: Introduction
 
Sai Sharan_UI_Resume
Sai Sharan_UI_ResumeSai Sharan_UI_Resume
Sai Sharan_UI_Resume
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
web development
web developmentweb development
web development
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
WEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxWEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptx
 

Recently uploaded

VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130Suhani Kapoor
 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightDelhi Call girls
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricksabhishekparmar618
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonDelhi Call girls
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...Suhani Kapoor
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...Amil baba
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girlsmodelanjalisharma4
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...Suhani Kapoor
 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpmainac1
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiSuhani Kapoor
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Douxkojalkojal131
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...kumaririma588
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Yantram Animation Studio Corporation
 

Recently uploaded (20)

VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
VIP Call Girls Service Kukatpally Hyderabad Call +91-8250192130
 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricks
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
 
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
NO1 Trending kala jadu Love Marriage Black Magic Punjab Powerful Black Magic ...
 
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call GirlsCBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
CBD Belapur Individual Call Girls In 08976425520 Panvel Only Genuine Call Girls
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUp
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service BhiwandiVIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
VIP Call Girls Bhiwandi Ananya 8250192130 Independent Escort Service Bhiwandi
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai DouxDubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
Dubai Call Girls Pro Domain O525547819 Call Girls Dubai Doux
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
Captivating Charm: Exploring Marseille's Hillside Villas with Our 3D Architec...
 

Future proof rwd

  • 2. ADAM CHAMBERS Senior Developer, Digital Surgeons ! @chambaz digitalsurgeons.com
  • 3.
  • 8. Future-proofing Responsive Web Designs. • Elastic layouts • Mobile first • Progressive enhancement • Modular & semantic • Lightweight & performant
  • 11. Elastic Layouts. • Rems Font sizes • Ems Structure, widths, heights, margins, padding •% Structure, widths, heights, margins, padding • Px Sprites, borders, rounded corners
  • 12. What is an em?
  • 13. “One em is equal to the computed value of the ‘font-size’ property of the element on which it is used”
  • 14. What is an em? body { font-size: 100%; } body header { font-size: 2em; } 1em = 16px 1em = 32px 2em = 32px 2em = 64px
  • 15. Elastic Layouts. • Rems Font sizes • Ems Structure, widths, heights, margins, padding •% Structure, widths, heights, margins, padding • Px Sprites, borders, rounded corners
  • 18. Absolute Typography. Base font size 16px Base font size 40px
  • 19. Relative Typography. Base font size 16px Base font size 40px
  • 20. Absolute / Relative Media Queries. Px base media query Em based media query
  • 22. Mobile first. • Often referred to by the misleading term “mobile first” • It’s really just common sense to start small and work up • Mobile browsing is fast overtaking desktop browsing • Forces focus by embracing the constraints of smaller devices • Lets call it “content first”
  • 23. Min-width Media Queries. Max-width Min-width .responsive-element { padding: 0; @include span-columns(6); .responsive-element { padding: 1em; width: 100%; @include media(min-width: 48em) { padding: 0; @include span-columns(6); } } ! } @include media(max-width: 48em) { padding: 1em; width: 100%; }
  • 25. Progressive Enhancement. • Progressively enhance rather than gracefully degrading • Starting simple and adding complexity causes far less headaches • Load your advanced features when supported • Just like our layouts, our functionality can grow and not shrink • Lets call it “content first”
  • 26. Progressive Enhancement. Cutting the mustard Progressive Enhancement // cutting the mustard if(‘querySelector’ in document && ‘localStorage’ in window && ‘addEventListener’ in window) { if(Modernizr.webp) { // use webp images } else if(Modernizr.svg) { // ok use sag then } ! } // all the things ! if(Modernizr.geolocation) { // geolocation wizardry } ! if(window.matchMedia(‘min-width: 48em’).matches) { // all the things }
  • 29. Sassy Modularity. • I’m sure we all agree that modularity is essential • Maintainability is essential in future proof applications • Placeholders are invisible, reusable blocks of CSS • Extend placeholders into classes for performant modularity • Sass allows us to create semantic, content driven classes
  • 30. Modular CSS. HTML CSS .product { width: 25%; padding: 2em; float: left; } .featured { width: red; } <div class=“product”> <!-— product markup —-> </div> ! <div class=“product featured”> <!-— featured product markup —-> </div>
  • 31. Modular Sass. SCSS %product { width: 25%; padding: 2em; float: left; } ! %featured { background: red; } HTML .product { @extend %product; } <div class=“product”> <!-— product markup —-> </div> ! ! .featured-product { @extend %product; @extend %featured; } <div class=“featured-product”> <!-— featured product markup —-> </div>
  • 32. Modular Sass. SCSS CSS %title { text-transform: uppercase; line-height: 3; color: #000; } .product-title, .cart-title { text-transform: uppercase; line-height: 3; color: #000; } ! .product-title { margin: 20px 0; @extend %title; } ! ! ! .cart-title { float: right; @extend %title; } .cart-title { float: right; } .product-title { margin: 20px 0; }
  • 34. Monolithic Frameworks. • Frameworks are essential for rapid development • Providing building blocks for your application • Large overhead and code bloat • Pick and choose exactly what you require
  • 35. Mixins. • Mixins are invisible, reusable blocks of CSS • Arguments and conditional logic • Mixin libraries have no overhead • Only use exactly what you require
  • 36. Mixin Libraries. .product { @include span-columns(4); } ! %outer-container { @include outer-container(); } ! .product-container { @extend %outer-container; } @mixin btn($color) { @extend %btn; background-color: $color; } ! .product-btn { @include btn(#c0392b); } ! .delete-btn { @include btn(#d54445); }
  • 37. jQuery. • jQuery is a fantastic library for cross browser development • Do you really need the entire 100kb? • Not just page weight but call stack size • Native JavaScript support is actually pretty good
  • 38. Vanilla JS. var products = document.querySelectorAll(‘.product’); ! var featuredProduct = document.querySelector(‘.featured-product’); ! [].forEach.call(products, function(product) { // do something with each product }); ! featuredProduct.classList.add(‘active’); featuredProduct.classList.remove(‘active’); featuredProduct.classList.contains(‘active’);
  • 39. Bower. • Dependency management for the front end • Micro-libraries over monolithic frameworks • Small libraries that serve a single purpose • Pick and choose exactly what you require
  • 40. Bower.json { "name": "Digital Surgeons", "version": "1.0.0", "private": true, "dependencies": { "normalize-scss": "~2.1.3", "responsive-comments": "~1.2.1", "html5-polyfills": "*", "matchmedia": "~0.1.0", "headroom.js": "~0.3.9", "raf.js": "~0.0.3", "respond": "~1.4.2", "html5shiv": "~3.7.0", "slider": "https://github.com/cferdinandi/slider.git", "swiper": "~2.4.3", "move.js": "https://github.com/visionmedia/move.js.git#~0.3.3", "imagesloaded": "~3.1.4" } }
  • 41. Grunt. • Task runner and build processes for the front end • Package your front end code for production • Compile, minify, concatenate, optimise • If at all possible, automate it
  • 42. Gruntfile.js files: { // global JS ‘js/dist/global.js’: [ ‘bower_components/raf.js/raf.min.js’, ‘bower_components/html5-polyfills/classList.js’, ‘bower_components/responsive-comments/responsive-comments.js’, ‘bower_components/anim/anim.min.js’, ‘bower_components/headroom.js/dist/headroom.js’, ‘js/src/global.js’ ], // global JS + page specific ‘js/dist/home.js’: [ ‘bower_components/swiper/dist/idangerous.swiper.js’, ‘bower_components/eventEmitter/EventEmitter.min.js’, ‘bower_components/eventie/eventie.js’, ‘bower_components/imagesloaded/imagesloaded.js’, ‘js/dist/global.js’, ‘js/src/slider.js’, ‘js/src/home.js’ ] } watch: { scripts: { files: [‘js/src/*.js’], tasks: [‘uglify’], options: { spawn: false, livereload: true } }, css: { files: ‘sass/*.scss’, tasks: [‘sass’], options: { livereload: true, } } }
  • 43. #perfmatters. • Performance is no longer just load time, it’s a feature • Rendering performance is essential in a world of client side apps • Use Chrome’s extensive Dev Tools to profile and optimise • Make your application run fast and smoothly over time
  • 46. Future-proofing Responsive Web Designs. • Elastic layouts • Mobile first • Progressive enhancement • Modular & semantic • Lightweight & performant
  • 47.
  • 48. “Amazing last quote with something meaningful and memorable.” #perfmatters
  • 49. FUTURE-PROOF RWD Follow me @chambaz digitalsurgeons.com