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 SASS Getting Started Guide

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 SASS Getting Started Guide (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

SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CANestorGamez6
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Sitegalleryaagency
 
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightCheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightDelhi Call girls
 
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...ankitnayak356677
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...Suhani Kapoor
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricksabhishekparmar618
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsCharles Obaleagbon
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonDelhi Call girls
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Delhi Call girls
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Roomdivyansh0kumar0
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 
A level Digipak development Presentation
A level Digipak development PresentationA level Digipak development Presentation
A level Digipak development Presentationamedia6
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdfSwaraliBorhade
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 

Recently uploaded (20)

SCRIP Lua HTTP PROGRACMACION PLC WECON CA
SCRIP Lua HTTP PROGRACMACION PLC  WECON CASCRIP Lua HTTP PROGRACMACION PLC  WECON CA
SCRIP Lua HTTP PROGRACMACION PLC WECON CA
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Site
 
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightCheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
young call girls in Pandav nagar 🔝 9953056974 🔝 Delhi escort Service
 
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...
Raj Nagar Extension Call Girls 9711199012 WhatsApp No, Delhi Escorts in Raj N...
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricks
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past Questions
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
A level Digipak development Presentation
A level Digipak development PresentationA level Digipak development Presentation
A level Digipak development Presentation
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 

SASS Getting Started Guide

  • 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; }