SlideShare a Scribd company logo
1 of 37
Syntactically Awesome Style Sheets
Getting Started 
Command Line 
• http://rubyinstaller.org/ 
• Open Ruby CMD -> gem install sass 
• Sass –v to check version 
• Navigate to styles directory 
• ‘Watch” the .scss file for updates 
• sass --watch main.scss:main.css 
• sass --watch main.scss:main.css --style compressed 
• Style Types: 
• nested, expanded, compact, compressed
Getting Started 
http://mhs.github.io/scout-app/
Getting Started 
Scout allows the configuration of individual project settings and 
compiling formats.
The Benefits of Detecting Redundant Styles
 A cleaner, more organized working codebase 
 Quicker updates and creation of styles 
 Optimized and more efficient compiled CSS 
 Save time from bottlenecks 
(ie: vendor-prefixes)
Getting Cozy with Nesting
#main-list { 
list-style: none; 
float: left; 
margin: 0; 
li { 
padding: 5px 10px; 
background: #333; 
a { 
color: #333; 
text-decoration: none; 
} 
} 
} 
Getting Cozy with Nesting 
#main-list { 
list-style: none; 
float: left; 
margin: 0; 
} 
#main-list li { 
padding: 5px 10px; 
background: #333; 
} 
#main-list li a { 
color: #333; 
text-decoration: none; 
}
a { 
text-decoration: none; 
color: #333; 
&:hover { 
color: #aaa; 
} 
} 
Getting Cozy with Nesting 
.featured-image { 
display: none; 
&.active { 
display: block; 
} 
} 
a { 
text-decoration: none; 
color: #333; 
} 
a:hover { 
color: #aaa; 
} 
.featured-image { 
display: none; 
} 
.featured-image.active { 
display: block; 
}
Consistency through $Variables
Consistency through $Variables 
Variables Types 
$background-color: #58a611; 
$img-path: “img/"; 
$isSet: true; 
$margins: 1em 1.5em 0 0; 
$map: (key1: value1, key2: value2, key3: value3);
$background-color: #58a611; 
$img-path: “img/"; 
Consistency through $Variables 
body { 
background: url(#{$img-path}/bg.jpg) $background-color; 
} 
body { 
background: url(img/bg.jpg) #58a611; 
}
Breaking Out the @Mixins
@mixin the-mixin-name() { 
// Block of Styles 
} 
Breaking Out the @Mixins 
Basic Syntax 
.theClass { 
@include the-mixin-name; 
}
@mixin the-mixin-name($theSize) { 
width: $theSize + px; 
} 
Breaking Out the @Mixins 
Parameter Syntax 
.theClass { 
@include the-mixin-name(100); 
} 
.theClass { 
width: 100px; 
}
@mixin the-mixin-name($theSize: 50) { 
width: $theSize + px; 
} 
Breaking Out the @Mixins 
Parameter Defaults Syntax 
.theClass { 
@include the-mixin-name(); 
} 
.theClass { 
width: 50px; 
}
@mixin color-class($theName, $theColor) { 
.#{$theName} { 
color: $theColor; 
} 
} 
Breaking Out the @Mixins 
.blueberry { 
color: #1f3e68; 
} 
@include color-class(‘blueberry', #1f3e68);
@mixin color-class($theName, $theColor) { 
.#{$theName}, .#{$theName} a, .#{$theName} a:visited, .#{$theName} a:link, .#{$theName} a:active { 
color: $theColor; 
} 
.#{$theName} a:hover { 
color: lighten($theColor, 10%); 
} 
} 
Breaking Out the @Mixins 
.blueberry, .blueberry a, .blueberry a:visited, .blueberry a:link, .blueberry a:active { 
color: #1f3e68; 
} 
.blueberry a:hover { 
color: #2b558f; 
}
Breaking Out the @Mixins 
http://chir.ag/projects/name-that-color/
$context: 14; 
@mixin font-class($font, $line: $font) { 
$line: ($line / $font); 
$font: ($font / $context); 
font-size: $font + em; 
line-height: $line + em; 
} 
Breaking Out the @Mixins 
.medium { 
@include font-class(16,19); 
} 
.medium { 
font-size: 1.14286em; 
line-height: 1.1875em; 
}
@mixin font-family($fam, $file, $class) { 
@font-face { 
font-family: '#{$fam}'; 
src: url('#{$font-path}#{$file}.eot'); 
src: url('#{$font-path}#{$file}.eot?#iefix') format('embedded-opentype'), 
url('#{$font-path}#{$file}.woff') format('woff'), 
url('#{$font-path}#{$file}.ttf') format('truetype'), 
url('#{$font-path}#{$file}.svg##{$fam}') format('svg'); 
font-weight: normal; 
font-style: normal; 
} 
.#{$class} { 
font-family: '#{$fam}'; 
} 
} 
Breaking Out the @Mixins
@font-face { 
font-family: "helvlightregular"; 
src: url("fonts/heln.eot"); 
src: url("fonts/heln.eot?#iefix") format("embedded-opentype"), url("fonts/heln.woff") format("woff"), url("fonts/heln.ttf") 
format("truetype"), url("fonts/heln.svg#helvlightregular") format("svg"); 
font-weight: normal; 
font-style: normal; 
} 
.helvlightregular { 
font-family: "helvlightregular"; 
} 
Breaking Out the @Mixins 
@include font-family('helvlightregular','heln','helvlightregular');
@mixin transform($style) { 
-webkit-transform: #{$style}; 
-moz-transform: #{$style}; 
-ms-transform: #{$style}; 
-o-transform: #{$style}; 
transform: #{$style}; 
} 
Breaking Out the @Mixins 
@include transform(rotate(6deg)); -webkit-transform: rotate(6deg); 
-moz-transform: rotate(6deg); 
-ms-transform: rotate(6deg); 
-o-transform: rotate(6deg); 
transform: rotate(6deg);
Getting @Functional
$context: 14; 
@function element-size($size, $theContext:$context) { 
$size: ($size / $theContext); 
@return $size + em; 
} 
Getting @Functional 
.pineapple { 
width: element-size(300); 
height: auto; 
border: 0; 
} 
.pineapple { 
width: 21.42857em; 
height: auto; 
border: 0; 
}
Under One…Maybe Two Conditions
@mixin yin-yang($isActive) { 
@if ($isActive) { 
display: block; 
} @else { 
display: none; 
} 
Under One…Maybe Two Conditions 
.yang { 
@include yin-yang(true); 
} 
.yang { 
display: block; 
}
@mixin general-styles($theView) { 
#header-main { 
Under One…Maybe Two Conditions 
@if $theView == full or $theView == mid or $theView == tablet { 
padding: 3px 0; 
height: element-size(100); 
} @else if $theView == smart { 
height: element-size(50); 
} @else { 
height: element-size(170); 
} 
} 
} 
@include general-styles(full);
Under One…Maybe Two Conditions 
@media only screen and (max-width: 25.875em) { 
@include universal-styles(dumb); 
@include global-styles(dumb); 
} 
@media only screen and (min-width: 25.9375em) and (max-width: 39.3125em) { 
@include universal-styles(smart); 
@include global-styles(smart); 
} 
@media only screen and (min-width: 39.375em) and (max-width: 54.625em) { 
@include universal-styles(tablet); 
@include global-styles(tablet); 
} 
@media only screen and (min-width: 54.6875em) and (max-width: 64.9375em) { 
@include universal-styles(mid); 
@include global-styles(mid); 
} 
@media only screen and (min-width: 65em) { 
@include universal-styles(full); 
@include global-styles(full); 
}
Getting Straight with Loops
@for 
-@for $var from <start> through <end> // Includes a loop for the <end> value 
- @for $var from <start> to <end> // Stops looping when <end> is reached 
@each 
- @each $var in <list> 
@while 
-@while <condition is true> (ie: $i < 10) 
Getting Straight with Loops 
Basic Syntax
@for $i from 1 to 4 { 
.theClass-#{$i} { 
width: #{$i}50px; 
} 
} 
Getting Straight with Loops 
@for Loop 
.theClass-1 { 
width: 150px; 
} 
.theClass-2 { 
width: 250px; 
} 
.theClass-3 { 
width: 350px; 
@for $i from 1 through 4 { } 
.theClass-#{$i} { 
width: #{$i}50px; 
} 
} 
.theClass-4 { 
width: 450px; 
}
$countries: sweden, denmark, finland, norway, germany; 
@each $country in $countries { 
.flag-#{$country} { 
background: url(img/#{$country}.png); 
} 
} 
Getting Straight with Loops 
@each Loop 
.flag-sweden { 
background: url(img/sweden.png); 
} 
.flag-denmark { 
background: url(img/denmark.png); 
} 
.flag-finland { 
background: url(img/finland.png); 
} 
.flag-norway { 
background: url(img/norway.png); 
} 
.flag-germany { 
background: url(img/germany.png); 
}
$countries: (sweden: #006699, denmark: #cc0000, finland: #fff, norway: #ef2b2c); 
@each $country, $color in $countries { 
.flag-#{$country} { 
background: url(img/#{$country}.png) $color; 
} 
} 
Getting Straight with Loops 
@each Loop 
.flag-sweden { 
background: url(img/sweden.png) #006699; } 
.flag-denmark { 
background: url(img/denmark.png) #cc0000; } 
.flag-finland { 
background: url(img/finland.png) #fff; } 
.flag-norway { 
background: url(img/norway.png) #ef2b2c; }
$hotspots: 3; 
$i: 1; 
@while $i <= $hotspots { 
.hotspot-#{$i} { 
top: 100px; 
left: 100px; 
} 
$i: $i+1; 
} 
Getting Straight with Loops 
@while Loop 
.hotspot-1 { 
top: 100px; 
left: 100px; 
} 
.hotspot-2 { 
top: 100px; 
left: 100px; 
} 
.hotspot-3 { 
top: 100px; 
left: 100px; 
}
http://www.bourbon.io
@Yuschick http://sass-lang.com/

More Related Content

What's hot

McrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsMcrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsTristan Ashley
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemWynn Netherland
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassClaudina Sarahe
 
My sql presentation
My sql presentationMy sql presentation
My sql presentationNikhil Jain
 
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Andrew Shitov
 
A little exercise with clojure macro
A little exercise with clojure macroA little exercise with clojure macro
A little exercise with clojure macroZehua Liu
 
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Kris Wallsmith
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSSSayanee Basu
 
Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Pitfalls to Avoid for Cascade Server Newbies by Lisa HallPitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Pitfalls to Avoid for Cascade Server Newbies by Lisa Hallhannonhill
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction SassZeeshan Ahmed
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With LessDavid Engel
 
Helvetia
HelvetiaHelvetia
HelvetiaESUG
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application DesignBryce Kerley
 
Wordcamp Fayetteville Pods Presentation (PDF)
Wordcamp Fayetteville Pods Presentation (PDF)Wordcamp Fayetteville Pods Presentation (PDF)
Wordcamp Fayetteville Pods Presentation (PDF)mpvanwinkle
 

What's hot (20)

McrFRED 39 | CSS Processors
McrFRED 39 | CSS ProcessorsMcrFRED 39 | CSS Processors
McrFRED 39 | CSS Processors
 
Accelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gemAccelerated Native Mobile Development with the Ti gem
Accelerated Native Mobile Development with the Ti gem
 
Cracking for the Blue Team
Cracking for the Blue TeamCracking for the Blue Team
Cracking for the Blue Team
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
Wsomdp
WsomdpWsomdp
Wsomdp
 
Finding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with CompassFinding a Better Way to CSS: Navigating Sass with Compass
Finding a Better Way to CSS: Navigating Sass with Compass
 
Substitution Cipher
Substitution CipherSubstitution Cipher
Substitution Cipher
 
My sql presentation
My sql presentationMy sql presentation
My sql presentation
 
Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6Text in search queries with examples in Perl 6
Text in search queries with examples in Perl 6
 
Inc
IncInc
Inc
 
A little exercise with clojure macro
A little exercise with clojure macroA little exercise with clojure macro
A little exercise with clojure macro
 
Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
 
Using Sass - Building on CSS
Using Sass - Building on CSSUsing Sass - Building on CSS
Using Sass - Building on CSS
 
Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Pitfalls to Avoid for Cascade Server Newbies by Lisa HallPitfalls to Avoid for Cascade Server Newbies by Lisa Hall
Pitfalls to Avoid for Cascade Server Newbies by Lisa Hall
 
Simple introduction Sass
Simple introduction SassSimple introduction Sass
Simple introduction Sass
 
My First Ruby
My First RubyMy First Ruby
My First Ruby
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
Helvetia
HelvetiaHelvetia
Helvetia
 
Advanced Technology for Web Application Design
Advanced Technology for Web Application DesignAdvanced Technology for Web Application Design
Advanced Technology for Web Application Design
 
Wordcamp Fayetteville Pods Presentation (PDF)
Wordcamp Fayetteville Pods Presentation (PDF)Wordcamp Fayetteville Pods Presentation (PDF)
Wordcamp Fayetteville Pods Presentation (PDF)
 

Similar to Raleigh Web Design Meetup Group - Sass Presentation

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockMarco Pinheiro
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sassKnoldus Inc.
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. The University of Akron
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageKatsunori Tanaka
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendFITC
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Startededgincvg
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with SassRob Friesel
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quickBilly Shih
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Anam Hossain
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and howmirahman
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentationMario Noble
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESSItai Koren
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compassChris Lee
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)emrox
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3A2 Comunicação
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassClaudina Sarahe
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"bentleyhoke
 

Similar to Raleigh Web Design Meetup Group - Sass Presentation (20)

SASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, GreensockSASS, Compass, Gulp, Greensock
SASS, Compass, Gulp, Greensock
 
Deep dive into sass
Deep dive into sassDeep dive into sass
Deep dive into sass
 
CSS3
CSS3CSS3
CSS3
 
Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors. Managing responsive websites with css preprocessors.
Managing responsive websites with css preprocessors.
 
LESS : The dynamic stylesheet language
LESS : The dynamic stylesheet languageLESS : The dynamic stylesheet language
LESS : The dynamic stylesheet language
 
CSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the BackendCSS: A Slippery Slope to the Backend
CSS: A Slippery Slope to the Backend
 
Sass and Compass - Getting Started
Sass and Compass - Getting StartedSass and Compass - Getting Started
Sass and Compass - Getting Started
 
Wrangling the CSS Beast with Sass
Wrangling the CSS Beast  with SassWrangling the CSS Beast  with Sass
Wrangling the CSS Beast with Sass
 
Learn Sass and Compass quick
Learn Sass and Compass quickLearn Sass and Compass quick
Learn Sass and Compass quick
 
Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01Css preprocessor-140606115334-phpapp01
Css preprocessor-140606115334-phpapp01
 
CSS preprocessor: why and how
CSS preprocessor: why and howCSS preprocessor: why and how
CSS preprocessor: why and how
 
Preprocessor presentation
Preprocessor presentationPreprocessor presentation
Preprocessor presentation
 
SASS is more than LESS
SASS is more than LESSSASS is more than LESS
SASS is more than LESS
 
Dallas Drupal Days 2012 - Introduction to less sass-compass
Dallas Drupal Days 2012  - Introduction to less sass-compassDallas Drupal Days 2012  - Introduction to less sass-compass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)Sass & Compass (Barcamp Stuttgart 2012)
Sass & Compass (Barcamp Stuttgart 2012)
 
Insertcustomer
InsertcustomerInsertcustomer
Insertcustomer
 
Keep calm and let's play CSS3
Keep calm and let's play CSS3Keep calm and let's play CSS3
Keep calm and let's play CSS3
 
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and CompassBringing sexy back to CSS: SASS/SCSS, LESS and Compass
Bringing sexy back to CSS: SASS/SCSS, LESS and Compass
 
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
Brian Hoke: WordCamp Toronto 2014 Presentation "Sass & WordPress"
 
Sass_Cubet seminar
Sass_Cubet seminarSass_Cubet seminar
Sass_Cubet seminar
 

Recently uploaded

DESIGN THINKING in architecture- Introduction
DESIGN THINKING in architecture- IntroductionDESIGN THINKING in architecture- Introduction
DESIGN THINKING in architecture- Introductionsivagami49
 
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Availabledollysharma2066
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxbingyichin04
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...instagramfab782445
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...Delhi Call girls
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...nirzagarg
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...amitlee9823
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja Nehwal
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxTusharBahuguna2
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...nirzagarg
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...Call Girls in Nagpur High Profile
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 

Recently uploaded (20)

DESIGN THINKING in architecture- Introduction
DESIGN THINKING in architecture- IntroductionDESIGN THINKING in architecture- Introduction
DESIGN THINKING in architecture- Introduction
 
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
 
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Basapura ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Hy...
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
B. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdfB. Smith. (Architectural Portfolio.).pdf
B. Smith. (Architectural Portfolio.).pdf
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Basavanagudi Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 

Raleigh Web Design Meetup Group - Sass Presentation

  • 2. Getting Started Command Line • http://rubyinstaller.org/ • Open Ruby CMD -> gem install sass • Sass –v to check version • Navigate to styles directory • ‘Watch” the .scss file for updates • sass --watch main.scss:main.css • sass --watch main.scss:main.css --style compressed • Style Types: • nested, expanded, compact, compressed
  • 4. Getting Started Scout allows the configuration of individual project settings and compiling formats.
  • 5. The Benefits of Detecting Redundant Styles
  • 6.  A cleaner, more organized working codebase  Quicker updates and creation of styles  Optimized and more efficient compiled CSS  Save time from bottlenecks (ie: vendor-prefixes)
  • 8. #main-list { list-style: none; float: left; margin: 0; li { padding: 5px 10px; background: #333; a { color: #333; text-decoration: none; } } } Getting Cozy with Nesting #main-list { list-style: none; float: left; margin: 0; } #main-list li { padding: 5px 10px; background: #333; } #main-list li a { color: #333; text-decoration: none; }
  • 9. a { text-decoration: none; color: #333; &:hover { color: #aaa; } } Getting Cozy with Nesting .featured-image { display: none; &.active { display: block; } } a { text-decoration: none; color: #333; } a:hover { color: #aaa; } .featured-image { display: none; } .featured-image.active { display: block; }
  • 11. Consistency through $Variables Variables Types $background-color: #58a611; $img-path: “img/"; $isSet: true; $margins: 1em 1.5em 0 0; $map: (key1: value1, key2: value2, key3: value3);
  • 12. $background-color: #58a611; $img-path: “img/"; Consistency through $Variables body { background: url(#{$img-path}/bg.jpg) $background-color; } body { background: url(img/bg.jpg) #58a611; }
  • 13. Breaking Out the @Mixins
  • 14. @mixin the-mixin-name() { // Block of Styles } Breaking Out the @Mixins Basic Syntax .theClass { @include the-mixin-name; }
  • 15. @mixin the-mixin-name($theSize) { width: $theSize + px; } Breaking Out the @Mixins Parameter Syntax .theClass { @include the-mixin-name(100); } .theClass { width: 100px; }
  • 16. @mixin the-mixin-name($theSize: 50) { width: $theSize + px; } Breaking Out the @Mixins Parameter Defaults Syntax .theClass { @include the-mixin-name(); } .theClass { width: 50px; }
  • 17. @mixin color-class($theName, $theColor) { .#{$theName} { color: $theColor; } } Breaking Out the @Mixins .blueberry { color: #1f3e68; } @include color-class(‘blueberry', #1f3e68);
  • 18. @mixin color-class($theName, $theColor) { .#{$theName}, .#{$theName} a, .#{$theName} a:visited, .#{$theName} a:link, .#{$theName} a:active { color: $theColor; } .#{$theName} a:hover { color: lighten($theColor, 10%); } } Breaking Out the @Mixins .blueberry, .blueberry a, .blueberry a:visited, .blueberry a:link, .blueberry a:active { color: #1f3e68; } .blueberry a:hover { color: #2b558f; }
  • 19. Breaking Out the @Mixins http://chir.ag/projects/name-that-color/
  • 20. $context: 14; @mixin font-class($font, $line: $font) { $line: ($line / $font); $font: ($font / $context); font-size: $font + em; line-height: $line + em; } Breaking Out the @Mixins .medium { @include font-class(16,19); } .medium { font-size: 1.14286em; line-height: 1.1875em; }
  • 21. @mixin font-family($fam, $file, $class) { @font-face { font-family: '#{$fam}'; src: url('#{$font-path}#{$file}.eot'); src: url('#{$font-path}#{$file}.eot?#iefix') format('embedded-opentype'), url('#{$font-path}#{$file}.woff') format('woff'), url('#{$font-path}#{$file}.ttf') format('truetype'), url('#{$font-path}#{$file}.svg##{$fam}') format('svg'); font-weight: normal; font-style: normal; } .#{$class} { font-family: '#{$fam}'; } } Breaking Out the @Mixins
  • 22. @font-face { font-family: "helvlightregular"; src: url("fonts/heln.eot"); src: url("fonts/heln.eot?#iefix") format("embedded-opentype"), url("fonts/heln.woff") format("woff"), url("fonts/heln.ttf") format("truetype"), url("fonts/heln.svg#helvlightregular") format("svg"); font-weight: normal; font-style: normal; } .helvlightregular { font-family: "helvlightregular"; } Breaking Out the @Mixins @include font-family('helvlightregular','heln','helvlightregular');
  • 23. @mixin transform($style) { -webkit-transform: #{$style}; -moz-transform: #{$style}; -ms-transform: #{$style}; -o-transform: #{$style}; transform: #{$style}; } Breaking Out the @Mixins @include transform(rotate(6deg)); -webkit-transform: rotate(6deg); -moz-transform: rotate(6deg); -ms-transform: rotate(6deg); -o-transform: rotate(6deg); transform: rotate(6deg);
  • 25. $context: 14; @function element-size($size, $theContext:$context) { $size: ($size / $theContext); @return $size + em; } Getting @Functional .pineapple { width: element-size(300); height: auto; border: 0; } .pineapple { width: 21.42857em; height: auto; border: 0; }
  • 26. Under One…Maybe Two Conditions
  • 27. @mixin yin-yang($isActive) { @if ($isActive) { display: block; } @else { display: none; } Under One…Maybe Two Conditions .yang { @include yin-yang(true); } .yang { display: block; }
  • 28. @mixin general-styles($theView) { #header-main { Under One…Maybe Two Conditions @if $theView == full or $theView == mid or $theView == tablet { padding: 3px 0; height: element-size(100); } @else if $theView == smart { height: element-size(50); } @else { height: element-size(170); } } } @include general-styles(full);
  • 29. Under One…Maybe Two Conditions @media only screen and (max-width: 25.875em) { @include universal-styles(dumb); @include global-styles(dumb); } @media only screen and (min-width: 25.9375em) and (max-width: 39.3125em) { @include universal-styles(smart); @include global-styles(smart); } @media only screen and (min-width: 39.375em) and (max-width: 54.625em) { @include universal-styles(tablet); @include global-styles(tablet); } @media only screen and (min-width: 54.6875em) and (max-width: 64.9375em) { @include universal-styles(mid); @include global-styles(mid); } @media only screen and (min-width: 65em) { @include universal-styles(full); @include global-styles(full); }
  • 31. @for -@for $var from <start> through <end> // Includes a loop for the <end> value - @for $var from <start> to <end> // Stops looping when <end> is reached @each - @each $var in <list> @while -@while <condition is true> (ie: $i < 10) Getting Straight with Loops Basic Syntax
  • 32. @for $i from 1 to 4 { .theClass-#{$i} { width: #{$i}50px; } } Getting Straight with Loops @for Loop .theClass-1 { width: 150px; } .theClass-2 { width: 250px; } .theClass-3 { width: 350px; @for $i from 1 through 4 { } .theClass-#{$i} { width: #{$i}50px; } } .theClass-4 { width: 450px; }
  • 33. $countries: sweden, denmark, finland, norway, germany; @each $country in $countries { .flag-#{$country} { background: url(img/#{$country}.png); } } Getting Straight with Loops @each Loop .flag-sweden { background: url(img/sweden.png); } .flag-denmark { background: url(img/denmark.png); } .flag-finland { background: url(img/finland.png); } .flag-norway { background: url(img/norway.png); } .flag-germany { background: url(img/germany.png); }
  • 34. $countries: (sweden: #006699, denmark: #cc0000, finland: #fff, norway: #ef2b2c); @each $country, $color in $countries { .flag-#{$country} { background: url(img/#{$country}.png) $color; } } Getting Straight with Loops @each Loop .flag-sweden { background: url(img/sweden.png) #006699; } .flag-denmark { background: url(img/denmark.png) #cc0000; } .flag-finland { background: url(img/finland.png) #fff; } .flag-norway { background: url(img/norway.png) #ef2b2c; }
  • 35. $hotspots: 3; $i: 1; @while $i <= $hotspots { .hotspot-#{$i} { top: 100px; left: 100px; } $i: $i+1; } Getting Straight with Loops @while Loop .hotspot-1 { top: 100px; left: 100px; } .hotspot-2 { top: 100px; left: 100px; } .hotspot-3 { top: 100px; left: 100px; }