SlideShare a Scribd company logo
The New UI 
Staying Strong with 
Flexbox, SASS, and 
{{Mustache}} 
1. Install Koala. 
http://koala-app.com/ 
(for Windows, Mac, Linux) 
Prep: 
2. Get source code zip file. 
https://github.com/ecarlisle/TheNewUI 
3. Pick any editor.
Who’s This Guy? 
Name: 
Craft: 
Crew: 
Locale: 
XP: 
Eric Carlisle 
UI / UX Architect 
Lookingglass - http://www.lgscout.com 
Baltimore, MD
Agenda 
∙ General Best Practices 
∙ SASS – variables, nesting, mixins, extensions 
∙ CSS Flexible Box Layout & responsive design 
∙ {{ mustache }} templating 
∙ Q/A
General Best Practices 
K 
I 
S 
S 
(Not quite what you think it means)
General Best Practices 
Keep 
It 
Stunningly 
Simple
General Best Practices 
K 
I 
S 
S 
Projects assets can be: 
∙ Approachable 
∙ Reusable 
∙ Maintainable 
∙ Self Documenting
General Best Practices 
K 
I 
S 
S 
Projects assets can 
be: 
Cost Saving! 
(Simple doesn’t have to be 
boring)
General Best Practices 
Ideal Project Execution
General Best Practices 
Ideal Project Execution 
Bare Necessity Comprehensiveness
General Best Practices 
Ideal Project Execution 
Mediocrity? Indulgence?
General Best Practices 
Ideal Project Execution 
Hacking Architecture
General Best Practices 
The right tool for the job.
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
SASS 
Stands for: 
Syntactically Awesome Style Sheets
SASS 
Stands for: 
Syntactically Awesome Style Sheets 
It is a: 
CSS Extension Language 
(a.k.a. CSS Preprocessor)
SASS 
Stands for: 
Syntactically Awesome Style Sheets 
It is a: 
CSS Extension Language 
(a.k.a. CSS Preprocessor) 
Ultimately: 
Keeps CSS Maintainable
Why do we need SASS? 
CSS Can Be: 
∙ Repetitive 
∙ Verbose 
∙ Inconsistently supported 
∙ A precedence nightmare 
∙ Not scalable
Why do we need SASS? 
SASS can make CSS: 
∙ DRY (don’t repeat yourself) 
∙ Modular 
∙ Reusable 
∙ Scalable 
Also see CSS frameworks like SMACSS (https://smacss.com)
SASS or SCSS Formatting? 
We will be using SCSS 
More Info: http://thesassway.com/editorial/sass-vs-scss-which-syntax-is-better
SASS Variables 
Name, value pairs. 
Examples: 
$font-stack: Lato, Helvetica, sans-serif; 
$blue: #369; 
$light-blue: lighten($blue, 40); // #b3cce6 
$font-size: 10px; 
$big-font-size: $font-size + 8px; // 18px 
Fun Color Function Tool: http://sassme.arc90.com/
SASS Nesting 
Source: 
nav { 
ul { 
list-style: none; 
li { 
display: inline-block; 
} 
} 
} 
Compiled: 
nav ul { 
list-style: none; 
} 
nav ul li { 
display: inline-block; 
} 
Creating a visual hierarchy
SASS Mixins 
For dynamic selector attributes 
Source: 
@mixin border-radius ($radius) { 
- webkit-border-radius: $radius; 
- moz-border-radius: $radius; 
-ms-border-radius: $radius; 
border-radius: $radius; 
} 
nav { 
border: solid 1px black; 
@include border-radius(5px); 
} 
Compiled: 
nav { 
border: solid 1px black; 
- webkit-border-radius: 5px; 
- moz-border-radius: 5px; 
-ms-border-radius: 5px; 
border-radius: 5px; 
}
SASS Extends 
Assigning inheritance (and keeping it clean) 
Source: 
.message { 
border: solid 1px #333; 
color: #FFFF; 
} 
.confirmation { 
@extend .message; 
background: #0F0; 
} 
.error { 
@extend .message; 
background: #F00; 
} 
Compiled: 
.message, .confirmation, .error { 
border: solid 1px #333; 
color: #FFFF; 
} 
.confirmation { 
background: #0F0; 
} 
.error{ 
background: #F00; 
}
Let’s Code!
Flexbox Layout
Flexbox Layout 
// Old version 
display: box; 
// Oldish version 
display: flexbox; 
// Today... 
display: flex;
Flexbox Layout 
// Old version 
display: box; 
// Oldish version 
display: flexbox; 
WC3 Working Draft 
http://dev.w3.org/csswg/css-flexbox/ 
// Today... 
display: flex; 
Browser Support 
http://caniuse.com/#feat=flexbox
What is Flexbox? 
“Aims at providing a more efficient way to lay out, 
align and distribute space among items in a 
container, even when their size is unknown and/or 
dynamic” 
http://css-tricks.com/snippets/css/a-guide-to-flexbox/
Why Flexbox? 
How can our content flow? 
<!– Block elements flow Vertically. --> 
<div></div> 
<div></div> 
<div></div> 
<!– Inline elements flow horizontally. --> 
<span></span> 
<span></span> 
<span></span> 
<!-- Flex elements flow... Well, it depends! :-) --> 
<container style=“display: flex”> 
<item></item> 
<item></item> 
<item></item> 
</container> 
*drumroll* 
? 
?
Why Flexbox? 
What about dimension? Space distribution? Alignment? 
<!– Things can get complicated pretty fast with CSS! --> 
<div> 
<div style=“float: left; margin: 10px; width: 200px”></div> 
<div style=“float: left: margin: 20px; padding: 10px; width: 4em”></div> 
<div style=“float: right; margin: 0; width: 50%></div> 
<div style=“clear: both”></div> 
</div>
Why Flexbox? 
Floats? Clears? Padding? Margins? 
What happens when... 
<!– Things can get chaotic in a hurry... --> 
<div> 
<div style=“float: left; margin: 10px; width: 200px”></div> 
<div style=“float: ∙ left: Different margin: 20px; padding: Screens? 
10px; width: 4em”></div> 
<div style=“float: right; margin: 0; width: 50%></div> 
<div style=“clear: both”></div> 
</div> 
∙ Different (dynamic) content? 
∙ Design Changes?
Why Flexbox? 
Responsive Frameworks to the rescue?
Why Flexbox? 
Responsive Frameworks to the rescue? 
BRILLIANT but… 
…Still pretty complicated!!!
The Flexbox Layout Box Model 
Dual axis flow!
The Flexbox Layout Box Model 
http://css-tricks.com/snippets/css/a-guide-to-flexbox/
Let’s Code!
{{Mustache}} 
{
Mustache.js 
Logicless Templating 
<!-- Example --> 
<script> 
data = {“name”: “Guy Incognito”, 
“company”: “Horizons Unlimited Ltd.”} 
output = Mustache.render(“Hello {{name}} from {{Company}}!”,data); 
</script>
Mustache.js 
Using an HTML script template 
<div id=“greeting”></div> 
<script> 
$template = $(“#template”).html(); 
data = {“name”: “Guy Incognito”, 
“company”: “Horizons Unlimited Ltd.”} 
output = Mustache.render($template ,data); 
</script> 
<script id=“template” type=“x-tmpl-mustache”> 
<p>Hello {{name}} from {{Company}}!</p> 
</script>
Let’s Code!
Q&A 
eric@ericcarlisle.com 
http://www.twitter.com/eric_carlisle 
http://www.slideshare.net/ericcarlisle

More Related Content

What's hot (20)

KEY
It's a Mod World - A Practical Guide to Rocking Modernizr
Michael Enslow
 
PDF
Mastering Grunt
Spencer Handley
 
KEY
Extending Custom Post Types
ryanduff
 
PPTX
Don't Over-React - just use Vue!
Raymond Camden
 
PDF
SocketStream
Paul Jensen
 
KEY
Rapid Testing, Rapid Development
mennovanslooten
 
PDF
Once upon a time, there were css, js and server-side rendering
Andrea Giannantonio
 
PPTX
HTML5 Web Workers-unleashed
Peter Lubbers
 
PDF
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
beyond tellerrand
 
PPT
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
ryanduff
 
PPTX
jQuery Conference Austin Sept 2013
dmethvin
 
PPTX
Bower - A package manager for the web
Larry Nung
 
PPTX
HTTP 2.0 - Web Unleashed 2015
dmethvin
 
PDF
Learning jQuery @ MIT
jeresig
 
PPT
Responsive Design with WordPress (WCPHX)
Joe Casabona
 
PDF
Mojolicious, real-time web framework
taggg
 
PPT
Yuihacku iitd-sumana
Sumana Hariharan
 
PDF
Getting started with flexbox
Adrian Sandu
 
PPTX
BOOM Performance
dapulse
 
PDF
HTTPS + Let's Encrypt
Walter Ebert
 
It's a Mod World - A Practical Guide to Rocking Modernizr
Michael Enslow
 
Mastering Grunt
Spencer Handley
 
Extending Custom Post Types
ryanduff
 
Don't Over-React - just use Vue!
Raymond Camden
 
SocketStream
Paul Jensen
 
Rapid Testing, Rapid Development
mennovanslooten
 
Once upon a time, there were css, js and server-side rendering
Andrea Giannantonio
 
HTML5 Web Workers-unleashed
Peter Lubbers
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
beyond tellerrand
 
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
ryanduff
 
jQuery Conference Austin Sept 2013
dmethvin
 
Bower - A package manager for the web
Larry Nung
 
HTTP 2.0 - Web Unleashed 2015
dmethvin
 
Learning jQuery @ MIT
jeresig
 
Responsive Design with WordPress (WCPHX)
Joe Casabona
 
Mojolicious, real-time web framework
taggg
 
Yuihacku iitd-sumana
Sumana Hariharan
 
Getting started with flexbox
Adrian Sandu
 
BOOM Performance
dapulse
 
HTTPS + Let's Encrypt
Walter Ebert
 

Viewers also liked (20)

PDF
Roberto Marras - An unusual portfolio
Roberto Marras
 
PPTX
Start With Strengths - Canadian Association of Principals 2015
Chris Wejr
 
PDF
Project Petersburg: An Xbox Kinect Ballet Videogame Proposal
John Scott Tynes
 
PDF
Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)
Rosenfeld Media
 
PDF
Stop disabling SELinux!
Maciej Lasyk
 
PDF
First-time users, longtime strategies: Why Parkinson’s Law is making you less...
Rosenfeld Media
 
PDF
Lightning Talk #11: Designer spaces by Alastair Simpson
ux singapore
 
PDF
16 Reasons Why You Need to Address Payment Security
Cognizant
 
PDF
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Kate Rutter
 
PPS
Ballet
guest99d5c9
 
PPTX
Roadmap Lightning Updates (November 3, 2016)
Salesforce Partners
 
PPTX
EURO Currency
skyranger_007
 
PPT
English projects
andygc25
 
PPT
Plani vjetor lëndor byirenakotobelli
irena kotobelli
 
PPTX
Do Real Company Stuff - Mozcon 2012 Version
Wil Reynolds
 
PPTX
English projects from 6th class!!!
nalbantis
 
DOCX
Projekt anglisht
Ueda Rrukaj
 
PPTX
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 
PPTX
Euromarket
Surabhi Kaushal
 
PPTX
Teatro del Renacimiento
diefer1
 
Roberto Marras - An unusual portfolio
Roberto Marras
 
Start With Strengths - Canadian Association of Principals 2015
Chris Wejr
 
Project Petersburg: An Xbox Kinect Ballet Videogame Proposal
John Scott Tynes
 
Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)
Rosenfeld Media
 
Stop disabling SELinux!
Maciej Lasyk
 
First-time users, longtime strategies: Why Parkinson’s Law is making you less...
Rosenfeld Media
 
Lightning Talk #11: Designer spaces by Alastair Simpson
ux singapore
 
16 Reasons Why You Need to Address Payment Security
Cognizant
 
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Kate Rutter
 
Ballet
guest99d5c9
 
Roadmap Lightning Updates (November 3, 2016)
Salesforce Partners
 
EURO Currency
skyranger_007
 
English projects
andygc25
 
Plani vjetor lëndor byirenakotobelli
irena kotobelli
 
Do Real Company Stuff - Mozcon 2012 Version
Wil Reynolds
 
English projects from 6th class!!!
nalbantis
 
Projekt anglisht
Ueda Rrukaj
 
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 
Euromarket
Surabhi Kaushal
 
Teatro del Renacimiento
diefer1
 
Ad

Similar to The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}} (20)

PPTX
SASS is more than LESS
Itai Koren
 
PDF
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
Kate Travers
 
PPT
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
PPTX
SCSS Implementation
Amey Parab
 
PPT
UNIT 3.ppt
kavi806657
 
PDF
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
PDF
CSS Workflow. Pre & Post
Anton Dosov
 
PDF
Refresh OKC
Nathan Smith
 
KEY
Slow kinda sucks
Tim Wright
 
PDF
Death of a Themer
James Panton
 
KEY
Authoring Stylesheets with Compass & Sass
chriseppstein
 
PPT
CSS előfeldolgozók
Máté Farkas
 
PDF
IV - CSS architecture
WebF
 
PDF
Web Frontend development: tools and good practices to (re)organize the chaos
Matteo Papadopoulos
 
PDF
CSS Frameworks
Mike Crabb
 
PDF
Create SASSy web parts in SPFx
Stefan Bauer
 
PDF
[Bauer] SASSy web parts with SPFX
European Collaboration Summit
 
PDF
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 
PDF
Hardboiled Front End Development — Found.ation
Spiros Martzoukos
 
SASS is more than LESS
Itai Koren
 
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
Kate Travers
 
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
SCSS Implementation
Amey Parab
 
UNIT 3.ppt
kavi806657
 
SASS, Compass, Gulp, Greensock
Marco Pinheiro
 
CSS Workflow. Pre & Post
Anton Dosov
 
Refresh OKC
Nathan Smith
 
Slow kinda sucks
Tim Wright
 
Death of a Themer
James Panton
 
Authoring Stylesheets with Compass & Sass
chriseppstein
 
CSS előfeldolgozók
Máté Farkas
 
IV - CSS architecture
WebF
 
Web Frontend development: tools and good practices to (re)organize the chaos
Matteo Papadopoulos
 
CSS Frameworks
Mike Crabb
 
Create SASSy web parts in SPFx
Stefan Bauer
 
[Bauer] SASSy web parts with SPFX
European Collaboration Summit
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Erin M. Kidwell
 
Hardboiled Front End Development — Found.ation
Spiros Martzoukos
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
July Patch Tuesday
Ivanti
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Biography of Daniel Podor.pdf
Daniel Podor
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
July Patch Tuesday
Ivanti
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 

The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}

  • 1. The New UI Staying Strong with Flexbox, SASS, and {{Mustache}} 1. Install Koala. http://koala-app.com/ (for Windows, Mac, Linux) Prep: 2. Get source code zip file. https://github.com/ecarlisle/TheNewUI 3. Pick any editor.
  • 2. Who’s This Guy? Name: Craft: Crew: Locale: XP: Eric Carlisle UI / UX Architect Lookingglass - http://www.lgscout.com Baltimore, MD
  • 3. Agenda ∙ General Best Practices ∙ SASS – variables, nesting, mixins, extensions ∙ CSS Flexible Box Layout & responsive design ∙ {{ mustache }} templating ∙ Q/A
  • 4. General Best Practices K I S S (Not quite what you think it means)
  • 5. General Best Practices Keep It Stunningly Simple
  • 6. General Best Practices K I S S Projects assets can be: ∙ Approachable ∙ Reusable ∙ Maintainable ∙ Self Documenting
  • 7. General Best Practices K I S S Projects assets can be: Cost Saving! (Simple doesn’t have to be boring)
  • 8. General Best Practices Ideal Project Execution
  • 9. General Best Practices Ideal Project Execution Bare Necessity Comprehensiveness
  • 10. General Best Practices Ideal Project Execution Mediocrity? Indulgence?
  • 11. General Best Practices Ideal Project Execution Hacking Architecture
  • 12. General Best Practices The right tool for the job.
  • 14. SASS Stands for: Syntactically Awesome Style Sheets
  • 15. SASS Stands for: Syntactically Awesome Style Sheets It is a: CSS Extension Language (a.k.a. CSS Preprocessor)
  • 16. SASS Stands for: Syntactically Awesome Style Sheets It is a: CSS Extension Language (a.k.a. CSS Preprocessor) Ultimately: Keeps CSS Maintainable
  • 17. Why do we need SASS? CSS Can Be: ∙ Repetitive ∙ Verbose ∙ Inconsistently supported ∙ A precedence nightmare ∙ Not scalable
  • 18. Why do we need SASS? SASS can make CSS: ∙ DRY (don’t repeat yourself) ∙ Modular ∙ Reusable ∙ Scalable Also see CSS frameworks like SMACSS (https://smacss.com)
  • 19. SASS or SCSS Formatting? We will be using SCSS More Info: http://thesassway.com/editorial/sass-vs-scss-which-syntax-is-better
  • 20. SASS Variables Name, value pairs. Examples: $font-stack: Lato, Helvetica, sans-serif; $blue: #369; $light-blue: lighten($blue, 40); // #b3cce6 $font-size: 10px; $big-font-size: $font-size + 8px; // 18px Fun Color Function Tool: http://sassme.arc90.com/
  • 21. SASS Nesting Source: nav { ul { list-style: none; li { display: inline-block; } } } Compiled: nav ul { list-style: none; } nav ul li { display: inline-block; } Creating a visual hierarchy
  • 22. SASS Mixins For dynamic selector attributes Source: @mixin border-radius ($radius) { - webkit-border-radius: $radius; - moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius; } nav { border: solid 1px black; @include border-radius(5px); } Compiled: nav { border: solid 1px black; - webkit-border-radius: 5px; - moz-border-radius: 5px; -ms-border-radius: 5px; border-radius: 5px; }
  • 23. SASS Extends Assigning inheritance (and keeping it clean) Source: .message { border: solid 1px #333; color: #FFFF; } .confirmation { @extend .message; background: #0F0; } .error { @extend .message; background: #F00; } Compiled: .message, .confirmation, .error { border: solid 1px #333; color: #FFFF; } .confirmation { background: #0F0; } .error{ background: #F00; }
  • 26. Flexbox Layout // Old version display: box; // Oldish version display: flexbox; // Today... display: flex;
  • 27. Flexbox Layout // Old version display: box; // Oldish version display: flexbox; WC3 Working Draft http://dev.w3.org/csswg/css-flexbox/ // Today... display: flex; Browser Support http://caniuse.com/#feat=flexbox
  • 28. What is Flexbox? “Aims at providing a more efficient way to lay out, align and distribute space among items in a container, even when their size is unknown and/or dynamic” http://css-tricks.com/snippets/css/a-guide-to-flexbox/
  • 29. Why Flexbox? How can our content flow? <!– Block elements flow Vertically. --> <div></div> <div></div> <div></div> <!– Inline elements flow horizontally. --> <span></span> <span></span> <span></span> <!-- Flex elements flow... Well, it depends! :-) --> <container style=“display: flex”> <item></item> <item></item> <item></item> </container> *drumroll* ? ?
  • 30. Why Flexbox? What about dimension? Space distribution? Alignment? <!– Things can get complicated pretty fast with CSS! --> <div> <div style=“float: left; margin: 10px; width: 200px”></div> <div style=“float: left: margin: 20px; padding: 10px; width: 4em”></div> <div style=“float: right; margin: 0; width: 50%></div> <div style=“clear: both”></div> </div>
  • 31. Why Flexbox? Floats? Clears? Padding? Margins? What happens when... <!– Things can get chaotic in a hurry... --> <div> <div style=“float: left; margin: 10px; width: 200px”></div> <div style=“float: ∙ left: Different margin: 20px; padding: Screens? 10px; width: 4em”></div> <div style=“float: right; margin: 0; width: 50%></div> <div style=“clear: both”></div> </div> ∙ Different (dynamic) content? ∙ Design Changes?
  • 32. Why Flexbox? Responsive Frameworks to the rescue?
  • 33. Why Flexbox? Responsive Frameworks to the rescue? BRILLIANT but… …Still pretty complicated!!!
  • 34. The Flexbox Layout Box Model Dual axis flow!
  • 35. The Flexbox Layout Box Model http://css-tricks.com/snippets/css/a-guide-to-flexbox/
  • 38. Mustache.js Logicless Templating <!-- Example --> <script> data = {“name”: “Guy Incognito”, “company”: “Horizons Unlimited Ltd.”} output = Mustache.render(“Hello {{name}} from {{Company}}!”,data); </script>
  • 39. Mustache.js Using an HTML script template <div id=“greeting”></div> <script> $template = $(“#template”).html(); data = {“name”: “Guy Incognito”, “company”: “Horizons Unlimited Ltd.”} output = Mustache.render($template ,data); </script> <script id=“template” type=“x-tmpl-mustache”> <p>Hello {{name}} from {{Company}}!</p> </script>
  • 41. Q&A [email protected] http://www.twitter.com/eric_carlisle http://www.slideshare.net/ericcarlisle