SlideShare a Scribd company logo
1 of 30
Download to read offline
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?)
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)
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!
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)
// 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!
One Tool
to Rule The All
$ 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

What's hot

Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developerHsuan Fu Lien
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSSTodd Anglin
 
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
 
Responsive & Responsible Web Design in DNN
Responsive & Responsible Web Design in DNNResponsive & Responsible Web Design in DNN
Responsive & Responsible Web Design in DNNgravityworksdd
 
Word press development for non developers
Word press development for non developers Word press development for non developers
Word press development for non developers Jessica C. Gardner
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPressSuzette Franck
 
What is Object Oriented CSS?
What is Object Oriented CSS?What is Object Oriented CSS?
What is Object Oriented CSS?Nicole Sullivan
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentEstelle Weyl
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive WebsitesJoe Seifi
 
Component Driven Design and Development
Component Driven Design and DevelopmentComponent Driven Design and Development
Component Driven Design and DevelopmentCristina Chumillas
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web developmentAlberto Apellidos
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...Jer Clarke
 

What's hot (20)

Understand front end developer
Understand front end developerUnderstand front end developer
Understand front end developer
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 
Html for beginners
Html for beginnersHtml for beginners
Html for beginners
 
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
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Responsive & Responsible Web Design in DNN
Responsive & Responsible Web Design in DNNResponsive & Responsible Web Design in DNN
Responsive & Responsible Web Design in DNN
 
Word press development for non developers
Word press development for non developers Word press development for non developers
Word press development for non developers
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
 
What is Object Oriented CSS?
What is Object Oriented CSS?What is Object Oriented CSS?
What is Object Oriented CSS?
 
Bootstrap 3 Basic - Bangkok WordPress Meetup
Bootstrap 3 Basic - Bangkok WordPress MeetupBootstrap 3 Basic - Bangkok WordPress Meetup
Bootstrap 3 Basic - Bangkok WordPress Meetup
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Using Core Themes in Drupal 8
Using Core Themes in Drupal 8Using Core Themes in Drupal 8
Using Core Themes in Drupal 8
 
ActiveDOM
ActiveDOMActiveDOM
ActiveDOM
 
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone developmentiPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
iPhone Web Applications: HTML5, CSS3 & dev tips for iPhone development
 
Responsive Websites
Responsive WebsitesResponsive Websites
Responsive Websites
 
Component Driven Design and Development
Component Driven Design and DevelopmentComponent Driven Design and Development
Component Driven Design and Development
 
Introduction to web development
Introduction to web developmentIntroduction to web development
Introduction to web development
 
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
DRY CSS A don’t-repeat-yourself methodology for creating efficient, unified a...
 
Web dev syllabus
Web dev syllabusWeb dev syllabus
Web dev syllabus
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 

Similar to Modern Front-End Development

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
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracketjnewmanux
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & PostAnton Dosov
 
Does my DIV look big in this?
Does my DIV look big in this?Does my DIV look big in this?
Does my DIV look big in this?glen_a_smith
 
JavaScript For People Who Don't Code
JavaScript For People Who Don't CodeJavaScript For People Who Don't Code
JavaScript For People Who Don't CodeChristopher Schmitt
 
Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Create SASSY Web Parts - SPSMilan
Create SASSY Web Parts - SPSMilan Stefan Bauer
 
From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)Joseph Chiang
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
Jina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesJina bolton - Refactoring Web Interfaces
Jina bolton - Refactoring Web InterfacesDevConFu
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on RailsAlessandro DS
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.jsMatthew Beale
 
WordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationWordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationJonny Allbut
 

Similar to Modern Front-End Development (20)

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

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

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?)
  • 10.
  • 11.
  • 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)
  • 13.
  • 14.
  • 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!
  • 16.
  • 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)
  • 21.
  • 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']); ! };
  • 24.
  • 25. One Tool to Rule The All
  • 26.
  • 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