SlideShare a Scribd company logo
1 of 41
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.
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

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
 
Extending Custom Post Types
Extending Custom Post Types Extending Custom Post Types
Extending Custom Post Types ryanduff
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Raymond Camden
 
Rapid Testing, Rapid Development
Rapid Testing, Rapid DevelopmentRapid Testing, Rapid Development
Rapid Testing, Rapid Developmentmennovanslooten
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingAndrea Giannantonio
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedPeter Lubbers
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015beyond tellerrand
 
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014ryanduff
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013dmethvin
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the webLarry Nung
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015dmethvin
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MITjeresig
 
Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Joe Casabona
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web frameworktaggg
 
Getting started with flexbox
Getting started with flexboxGetting started with flexbox
Getting started with flexboxAdrian Sandu
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performancedapulse
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's EncryptWalter Ebert
 

What's hot (20)

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
 
Mastering Grunt
Mastering GruntMastering Grunt
Mastering Grunt
 
Extending Custom Post Types
Extending Custom Post Types Extending Custom Post Types
Extending Custom Post Types
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
SocketStream
SocketStreamSocketStream
SocketStream
 
Rapid Testing, Rapid Development
Rapid Testing, Rapid DevelopmentRapid Testing, Rapid Development
Rapid Testing, Rapid Development
 
Once upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side renderingOnce upon a time, there were css, js and server-side rendering
Once upon a time, there were css, js and server-side rendering
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
Scott Jehl - Delivering Responsibly - beyond tellerrand Düsseldorf 2015
 
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
So You Want to Build and Release a Plugin? WordCamp Lancaster 2014
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
Bower - A package manager for the web
Bower - A package manager for the webBower - A package manager for the web
Bower - A package manager for the web
 
HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015HTTP 2.0 - Web Unleashed 2015
HTTP 2.0 - Web Unleashed 2015
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)Responsive Design with WordPress (WCPHX)
Responsive Design with WordPress (WCPHX)
 
Mojolicious, real-time web framework
Mojolicious, real-time web frameworkMojolicious, real-time web framework
Mojolicious, real-time web framework
 
Yuihacku iitd-sumana
Yuihacku iitd-sumanaYuihacku iitd-sumana
Yuihacku iitd-sumana
 
Getting started with flexbox
Getting started with flexboxGetting started with flexbox
Getting started with flexbox
 
BOOM Performance
BOOM PerformanceBOOM Performance
BOOM Performance
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's Encrypt
 

Viewers also liked

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

Viewers also liked (20)

Roberto Marras - An unusual portfolio
Roberto Marras - An unusual portfolioRoberto Marras - An unusual portfolio
Roberto Marras - An unusual portfolio
 
Start With Strengths - Canadian Association of Principals 2015
Start With Strengths - Canadian Association of Principals 2015Start With Strengths - Canadian Association of Principals 2015
Start With Strengths - Canadian Association of Principals 2015
 
Project Petersburg: An Xbox Kinect Ballet Videogame Proposal
Project Petersburg: An Xbox Kinect Ballet Videogame ProposalProject Petersburg: An Xbox Kinect Ballet Videogame Proposal
Project Petersburg: An Xbox Kinect Ballet Videogame Proposal
 
Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)
Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)
Beyond the Toolkit (Nathan Curtis at Enterprise UX 2016)
 
Stop disabling SELinux!
Stop disabling SELinux!Stop disabling SELinux!
Stop disabling SELinux!
 
First-time users, longtime strategies: Why Parkinson’s Law is making you less...
First-time users, longtime strategies: Why Parkinson’s Law is making you less...First-time users, longtime strategies: Why Parkinson’s Law is making you less...
First-time users, longtime strategies: Why Parkinson’s Law is making you less...
 
Lightning Talk #11: Designer spaces by Alastair Simpson
Lightning Talk #11: Designer spaces by Alastair SimpsonLightning Talk #11: Designer spaces by Alastair Simpson
Lightning Talk #11: Designer spaces by Alastair Simpson
 
16 Reasons Why You Need to Address Payment Security
16 Reasons Why You Need to Address Payment Security16 Reasons Why You Need to Address Payment Security
16 Reasons Why You Need to Address Payment Security
 
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
Sketchnotes-SF Meetup :: Round 17 :: People & Faces [Wed Apr 29, 2015]
 
Ballet
BalletBallet
Ballet
 
Roadmap Lightning Updates (November 3, 2016)
Roadmap Lightning Updates (November 3, 2016)Roadmap Lightning Updates (November 3, 2016)
Roadmap Lightning Updates (November 3, 2016)
 
EURO Currency
EURO CurrencyEURO Currency
EURO Currency
 
English projects
English projectsEnglish projects
English projects
 
Plani vjetor lëndor byirenakotobelli
Plani vjetor lëndor byirenakotobelliPlani vjetor lëndor byirenakotobelli
Plani vjetor lëndor byirenakotobelli
 
Do Real Company Stuff - Mozcon 2012 Version
Do Real Company Stuff - Mozcon 2012 Version Do Real Company Stuff - Mozcon 2012 Version
Do Real Company Stuff - Mozcon 2012 Version
 
English projects from 6th class!!!
English projects from 6th class!!!English projects from 6th class!!!
English projects from 6th class!!!
 
Projekt anglisht
Projekt anglishtProjekt anglisht
Projekt anglisht
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
 
Euromarket
EuromarketEuromarket
Euromarket
 
Teatro del Renacimiento
Teatro del Renacimiento Teatro del Renacimiento
Teatro del Renacimiento
 

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

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignCSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignKate Travers
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)Folio3 Software
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS ImplementationAmey Parab
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & PostAnton Dosov
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucksTim Wright
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sasschriseppstein
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozókMáté Farkas
 
IV - CSS architecture
IV - CSS architectureIV - CSS architecture
IV - CSS architectureWebF
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosMatteo Papadopoulos
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS FrameworksMike Crabb
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFxStefan Bauer
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationSpiros Martzoukos
 

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

SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented DesignCSMess to OOCSS: Refactoring CSS with Object Oriented Design
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
 
SCSS Implementation
SCSS ImplementationSCSS Implementation
SCSS Implementation
 
UNIT 3.ppt
UNIT 3.pptUNIT 3.ppt
UNIT 3.ppt
 
SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
CSS Workflow. Pre & Post
CSS Workflow. Pre & PostCSS Workflow. Pre & Post
CSS Workflow. Pre & Post
 
Refresh OKC
Refresh OKCRefresh OKC
Refresh OKC
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Authoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & SassAuthoring Stylesheets with Compass & Sass
Authoring Stylesheets with Compass & Sass
 
CSS előfeldolgozók
CSS előfeldolgozókCSS előfeldolgozók
CSS előfeldolgozók
 
IV - CSS architecture
IV - CSS architectureIV - CSS architecture
IV - CSS architecture
 
CSS3
CSS3CSS3
CSS3
 
Web Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaosWeb Frontend development: tools and good practices to (re)organize the chaos
Web Frontend development: tools and good practices to (re)organize the chaos
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
Create SASSy web parts in SPFx
Create SASSy web parts in SPFxCreate SASSy web parts in SPFx
Create SASSy web parts in SPFx
 
[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX[Bauer] SASSy web parts with SPFX
[Bauer] SASSy web parts with SPFX
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Hardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ationHardboiled Front End Development — Found.ation
Hardboiled Front End Development — Found.ation
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

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.
  • 13.
  • 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 eric@ericcarlisle.com http://www.twitter.com/eric_carlisle http://www.slideshare.net/ericcarlisle