SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
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
 
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
 

Último (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"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
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

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