SlideShare a Scribd company logo
MODERN FRONT-END
DEVELOPMENT
Drupal Camp LA 2013	

!

Matthew Wrather	

Wrather Creative
ABOUT ME
• Freelance

Drupal Developer

and Web Generalist since 1997	


• Drupal
• Most

since 4.6	


Definitely Available for Work!

matt@wrathercreative.com

(510) WRA-THER
AGENDA
1. Overview of the history of front-end development	

2. Review of some awesome tools	

3. The part you all came to see
Front-end
Developer
SASS
(and LESS, Stylus, etc.)	

!

http://sass-lang.com
VARIABLES
$blue: #3bbfce;

$margin: 16px;


/* CSS */








.content-navigation {

border-color: $blue;

color:

darken($blue, 9%);

}




.border {

padding: $margin / 2;

margin: $margin / 2;

border-color: $blue;

}


.content-navigation {

border-color: #3bbfce;

color: #2b9eab;

}




.border {

padding: 8px;

margin: 8px;

border-color: #3bbfce;

}
MIXINS
table.hl {

margin: 2em 0;

td.ln {

text-align: right;

}

}

li {

font: {

family: serif;

weight: bold;

size: 1.2em;

}

}


/* CSS */




table.hl {

margin: 2em 0;

}

table.hl td.ln {

text-align: right;

}




li {

font-family: serif;

font-weight: bold;

font-size: 1.2em;

}
NESTING/EXTENDING
@mixin left($dist) {

float: left;

margin-left: $dist;

}


#data {

float: left;

margin-left: 10px;

}

#data {

@include left(10px);

}

error {

border: 1px #f00;

background: #fdd;

}

.badError {

@extend .error;

border-width: 3px;

}


.error, .badError {

border: 1px #f00;

background: #fdd;

}

.badError {

border-width: 3px;

}
COMPASS
• Commonly

used mixins and @imports, including:	


• Typography

(vertical rhythm with auto-calculation

of line-height and margin)	


• CSS3

with vendor prefixes	


• Sprites

(though honestly, we’re using icon fonts, right?)
Modern Front-End Development
Modern Front-End Development
FRONT-END FRAMEWORKS
• Pre-build
• Built-in

CSS and JS to address 80% of use-cases 	


grid systems (fixed/fluid)	


• Good

type defaults, buttons, pretty forms, tables, code
styles…	


• Commonly-used

elements like nav bars, menus with
dropdowns, thumbnail grids, etc.	


• Javascript

to power interactivity (menus, rotators)
Modern Front-End Development
Modern Front-End Development
FIRST PROBLEM:
TOO MANY LIBRARIES
• How

do you get jQuery?	


• Visit

the website, click to download the package, open the
zip, navigate, find the file that you want, copy it into the
codebase? Hell no!	


• Remember
• What

the URL and wget? Hell no!	


about vendor libraries that have other vendor libraries
as dependencies? Remember them? Hell no!
Modern Front-End Development
NEXT PROBLEM:
TOO MANY <SCRIPT> TAGS
• So

now we’ve got all these things installed.	


• That’s

a lot of scripts. Especially since we’re good
developers and put our Backbone models, collections, and
views in separate files.	


• And
• So…
• Hell

we have to load them all in to the page.	


um…a lot of script tags? In a particular order?	


no!
<script data-main="scripts/main"
src="scripts/require.js"></script>
// main.js!
!

index.html

require(!
["helper/util"],!
function(util) {!
!

!

scripts/
main.js
require.js
!

helper/
util.js

// This function is called when!
// scripts/helper/util.js!
// is loaded.!
!

// If util.js calls define(),!
// then this function is not fired!
// until util's dependencies load. !
!

// The util argument will hold!
// the module value for!
// "helper/util".!
!

});
NEXT PROBLEM:
TOO MANY THINGS TO DO
• We

compile SASS and squash it down to one script	


• We

optimize images	


• We

compile any Coffeescript to JS 	


• We

lint the javascript using jsHint to catch problems	


• We

run any automated tests	


• We

concatenate and minify scripts and rewrite the script
tags in the HTML	


• We

run LiveReload (which requires a JS snippet on dev)
Modern Front-End Development
// gruntfile!
!
module.exports = function(grunt) {	

!
// Project configuration.	
grunt.initConfig({	
pkg: grunt.file.readJSON('package.json'),	
uglify: {	
options: {	
banner: '/*! <%= pkg.name %> */n'	
},	
build: {	
src: 'src/<%= pkg.name %>.js',	
dest: 'build/<%= pkg.name %>.min.js'	
}	
}	
});	

package.json
(used by npm)
!

Gruntfile
!

// Load the plugin that provides	
// the "uglify" task.	
grunt.loadNpmTasks('grunt-contrib-uglify');	

!
// Default task(s).	
grunt.registerTask('default', ['uglify']);	

!
};
NEXT PROBLEM:
TOO MANY TOOLS!
Modern Front-End Development
One Tool
to Rule The All
Modern Front-End Development
$ YO WEBAPP
$%% Gruntfile.js
$%% bower.json
$%% node_modules/
$%% package.json
$%% test
&
$%% index.html
&
$%% lib/
&
'%% spec/
$%% styles/
&  
'%% main.scss
'%% app
!

$%% index.html
$%% 404.html
$%% favicon.ico
$%% robots.txt

$%% bower_components/
&   $%% jquery/
&   $%% modernizr/
&   '%% sass-bootstrap/
$%% images/
'%% scripts/
   $%% app.js
   $%% hello.coffee
   $%% main.js
   '%% vendor/
$ GRUNT BUILD
$%% index.html
$%% 404.html
$%% robots.txt
$%% favicon.ico
$%% images
&   $%% 5d462625.glyphicons-halflings-white.png
&   '%% 9cc6609b.glyphicons-halflings.png
$%% scripts
&   $%% 349a65db.main.js
&   '%% vendor
&  
'%% f7f27360.modernizr.js
'%% styles
'%% c04706fe.main.css
DEMO
THANK YOU!
Matthew Wrather • @mwrather	

matt@wrathercreative.com • (510) WRA-THER

More Related Content

PDF
Front End Tooling and Performance - Codeaholics HK 2015
PDF
Front End Development - Beyond Javascript (Robin Cannon)
PDF
A modern front end development workflow for Magnolia at Atlassian
KEY
Why You Need a Front End Developer
PDF
Front End Best Practices
PPTX
Basics of Front End Web Dev PowerPoint
PDF
Front-End Frameworks: a quick overview
PPTX
HTML CSS and Web Development
Front End Tooling and Performance - Codeaholics HK 2015
Front End Development - Beyond Javascript (Robin Cannon)
A modern front end development workflow for Magnolia at Atlassian
Why You Need a Front End Developer
Front End Best Practices
Basics of Front End Web Dev PowerPoint
Front-End Frameworks: a quick overview
HTML CSS and Web Development

What's hot (20)

PDF
Understand front end developer
PPTX
Doing More with LESS for CSS
PDF
Html for beginners
PDF
Responsive Web Design: Clever Tips and Techniques
KEY
HTML CSS & Javascript
PDF
Responsive & Responsible Web Design in DNN
PPTX
Word press development for non developers
PDF
How to use CSS3 in WordPress
KEY
What is Object Oriented CSS?
PDF
Bootstrap 3 Basic - Bangkok WordPress Meetup
KEY
It's a Mod World - A Practical Guide to Rocking Modernizr
PDF
Using Core Themes in Drupal 8
PDF
PPTX
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
PDF
Responsive Websites
PDF
Component Driven Design and Development
PDF
Introduction to web development
PDF
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
PDF
Web dev syllabus
PPT
Please dont touch-3.6-jsday
Understand front end developer
Doing More with LESS for CSS
Html for beginners
Responsive Web Design: Clever Tips and Techniques
HTML CSS & Javascript
Responsive & Responsible Web Design in DNN
Word press development for non developers
How to use CSS3 in WordPress
What is Object Oriented CSS?
Bootstrap 3 Basic - Bangkok WordPress Meetup
It's a Mod World - A Practical Guide to Rocking Modernizr
Using Core Themes in Drupal 8
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
Responsive Websites
Component Driven Design and Development
Introduction to web development
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
Web dev syllabus
Please dont touch-3.6-jsday
Ad

Similar to Modern Front-End Development (20)

PDF
Solid and Sustainable Development in Scala
PDF
Solid And Sustainable Development in Scala
PDF
Death of a Themer
KEY
Advanced sass/compass
PDF
Killing the Angle Bracket
PDF
CSS Workflow. Pre & Post
KEY
Team styles
PPT
UNIT 3.ppt
PDF
Does my DIV look big in this?
PDF
DSLs in JavaScript
KEY
JavaScript For People Who Don't Code
PDF
Create SASSY Web Parts - SPSMilan
PPTX
Word Press As A Cms
PDF
From Hacker to Programmer (w/ Webpack, Babel and React)
PDF
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
PDF
Jina bolton - Refactoring Web Interfaces
PDF
Introduction to Ruby on Rails
PDF
Volunteer.rb
PDF
Parse Apps with Ember.js
PDF
WordCamp Sheffield 2014 Theme Workflow Presentation
Solid and Sustainable Development in Scala
Solid And Sustainable Development in Scala
Death of a Themer
Advanced sass/compass
Killing the Angle Bracket
CSS Workflow. Pre & Post
Team styles
UNIT 3.ppt
Does my DIV look big in this?
DSLs in JavaScript
JavaScript For People Who Don't Code
Create SASSY Web Parts - SPSMilan
Word Press As A Cms
From Hacker to Programmer (w/ Webpack, Babel and React)
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Jina bolton - Refactoring Web Interfaces
Introduction to Ruby on Rails
Volunteer.rb
Parse Apps with Ember.js
WordCamp Sheffield 2014 Theme Workflow Presentation
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Modernizing your data center with Dell and AMD
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Approach and Philosophy of On baking technology
PDF
cuic standard and advanced reporting.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PPTX
MYSQL Presentation for SQL database connectivity
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Modernizing your data center with Dell and AMD
The AUB Centre for AI in Media Proposal.docx
Approach and Philosophy of On baking technology
cuic standard and advanced reporting.pdf
A Presentation on Artificial Intelligence
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
MYSQL Presentation for SQL database connectivity

Modern Front-End Development

  • 1. MODERN FRONT-END DEVELOPMENT Drupal Camp LA 2013 ! Matthew Wrather Wrather Creative
  • 2. ABOUT ME • Freelance Drupal Developer
 and Web Generalist since 1997 • Drupal • Most since 4.6 Definitely Available for Work!
 matt@wrathercreative.com
 (510) WRA-THER
  • 3. AGENDA 1. Overview of the history of front-end development 2. Review of some awesome tools 3. The part you all came to see
  • 5. SASS (and LESS, Stylus, etc.) ! http://sass-lang.com
  • 6. VARIABLES $blue: #3bbfce;
 $margin: 16px;
 /* CSS */
 
 
 .content-navigation {
 border-color: $blue;
 color:
 darken($blue, 9%);
 }
 
 .border {
 padding: $margin / 2;
 margin: $margin / 2;
 border-color: $blue;
 }
 .content-navigation {
 border-color: #3bbfce;
 color: #2b9eab;
 }
 
 .border {
 padding: 8px;
 margin: 8px;
 border-color: #3bbfce;
 }
  • 7. MIXINS table.hl {
 margin: 2em 0;
 td.ln {
 text-align: right;
 }
 }
 li {
 font: {
 family: serif;
 weight: bold;
 size: 1.2em;
 }
 }
 /* CSS */
 
 table.hl {
 margin: 2em 0;
 }
 table.hl td.ln {
 text-align: right;
 }
 
 li {
 font-family: serif;
 font-weight: bold;
 font-size: 1.2em;
 }
  • 8. NESTING/EXTENDING @mixin left($dist) {
 float: left;
 margin-left: $dist;
 }
 #data {
 float: left;
 margin-left: 10px;
 } #data {
 @include left(10px);
 }
 error {
 border: 1px #f00;
 background: #fdd;
 }
 .badError {
 @extend .error;
 border-width: 3px;
 }
 .error, .badError {
 border: 1px #f00;
 background: #fdd;
 }
 .badError {
 border-width: 3px;
 }
  • 9. COMPASS • Commonly used mixins and @imports, including: • Typography (vertical rhythm with auto-calculation
 of line-height and margin) • CSS3 with vendor prefixes • Sprites (though honestly, we’re using icon fonts, right?)
  • 12. FRONT-END FRAMEWORKS • Pre-build • Built-in CSS and JS to address 80% of use-cases grid systems (fixed/fluid) • Good type defaults, buttons, pretty forms, tables, code styles… • Commonly-used elements like nav bars, menus with dropdowns, thumbnail grids, etc. • Javascript to power interactivity (menus, rotators)
  • 15. FIRST PROBLEM: TOO MANY LIBRARIES • How do you get jQuery? • Visit the website, click to download the package, open the zip, navigate, find the file that you want, copy it into the codebase? Hell no! • Remember • What the URL and wget? Hell no! about vendor libraries that have other vendor libraries as dependencies? Remember them? Hell no!
  • 17. NEXT PROBLEM: TOO MANY <SCRIPT> TAGS • So now we’ve got all these things installed. • That’s a lot of scripts. Especially since we’re good developers and put our Backbone models, collections, and views in separate files. • And • So… • Hell we have to load them all in to the page. um…a lot of script tags? In a particular order? no!
  • 19. // main.js! ! index.html require(! ["helper/util"],! function(util) {! ! ! scripts/ main.js require.js ! helper/ util.js // This function is called when! // scripts/helper/util.js! // is loaded.! ! // If util.js calls define(),! // then this function is not fired! // until util's dependencies load. ! ! // The util argument will hold! // the module value for! // "helper/util".! ! });
  • 20. NEXT PROBLEM: TOO MANY THINGS TO DO • We compile SASS and squash it down to one script • We optimize images • We compile any Coffeescript to JS • We lint the javascript using jsHint to catch problems • We run any automated tests • We concatenate and minify scripts and rewrite the script tags in the HTML • We run LiveReload (which requires a JS snippet on dev)
  • 22. // gruntfile! ! module.exports = function(grunt) { ! // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify: { options: { banner: '/*! <%= pkg.name %> */n' }, build: { src: 'src/<%= pkg.name %>.js', dest: 'build/<%= pkg.name %>.min.js' } } }); package.json (used by npm) ! Gruntfile ! // Load the plugin that provides // the "uglify" task. grunt.loadNpmTasks('grunt-contrib-uglify'); ! // Default task(s). grunt.registerTask('default', ['uglify']); ! };
  • 25. One Tool to Rule The All
  • 27. $ YO WEBAPP $%% Gruntfile.js $%% bower.json $%% node_modules/ $%% package.json $%% test & $%% index.html & $%% lib/ & '%% spec/ $%% styles/ &   '%% main.scss '%% app ! $%% index.html $%% 404.html $%% favicon.ico $%% robots.txt
 $%% bower_components/ &   $%% jquery/ &   $%% modernizr/ &   '%% sass-bootstrap/ $%% images/ '%% scripts/    $%% app.js    $%% hello.coffee    $%% main.js    '%% vendor/
  • 28. $ GRUNT BUILD $%% index.html $%% 404.html $%% robots.txt $%% favicon.ico $%% images &   $%% 5d462625.glyphicons-halflings-white.png &   '%% 9cc6609b.glyphicons-halflings.png $%% scripts &   $%% 349a65db.main.js &   '%% vendor &   '%% f7f27360.modernizr.js '%% styles '%% c04706fe.main.css
  • 29. DEMO
  • 30. THANK YOU! Matthew Wrather • @mwrather matt@wrathercreative.com • (510) WRA-THER