SlideShare a Scribd company logo
CSS with superpowers ― 
SASS! 
Ferdinand Vogler 
@ferdinandvogler
Ferdinand Vogler 
@ferdinandvogler 
Communication Design student, 
Working student at YOU IS NOW, 
Freelance Designer and Web-Developer
CSS with superpowers - SASS!
OpenTechSchool 
opentechschool.org 
Berlin, Brussels, Dortmund, Hamburg, Istanbul, Jerusalem, London, 
Melbourne, Nairobi, Ramallah, RheinMain, Stockholm, San Francisco, Tel- 
Aviv, Washington, Zürich
“If you really want to learn how to do something, try 
teaching other people how to do it.” 
– Steve Krug, Rocket Surgery Made Easy
Why SASS?
1996 
First W3C recommendation (CSS1)
2014
Preprocessors
Advantages 
❏ Variables 
❏ Nesting 
❏ Reusable blocks 
❏ Fewer HTTP requests 
❏ Conditionals, Loops & Functions 
❏ Mathematics 
Don’t Repeat Yourself
How does it work? 
style.scss Preprocessor style.css
style.css 
scss 
a { 
color: gray; 
} 
a:hover { 
color: black; 
font-weight: bold; 
} 
p { 
margin: 10px; 
}
“Later, when you’ve become fluent with Sass 
[…], it really does feel like a natural extension 
of CSS — as if it’s filling holes we all wish 
were filled by the CSS spec itself.” 
Dan Cederholm in alistapart.com/article/why-sass
ಠ_ಠ
Nope.
SASS? 
SCSS? 
?
style.scss style.sass 
@mixin border-radius($radius) { 
-webkit-border-radius: $radius; 
-moz-border-radius: $radius; 
-ms-border-radius: $radius; 
border-radius: $radius; 
} 
#main { 
background: gray; 
width: 50%; 
@include border-radius(4px); 
p { 
background: lightgray; 
color: black; 
} 
} 
=border-radius($radius) 
––-webkit-border-radius: $radius 
––-moz-border-radius: $radius 
––-ms-border-radius: $radius 
––border-radius: $radius 
#main 
––background: gray 
––width: 50% 
––+border-radius(4px) 
––p 
––––background: lightgray 
––––color: black
Install SASS
Ruby Gems 
Mac 
Open Terminal: ruby -v 
Windows 
Install from www.rubyinstaller.org
Installation 
Mac 
sudo gem install sass 
Windows 
gem install sass
Apps 
CodeKit 
Prepros 
Scout 
Koala 
Compass 
Hammer 
Mixture 
LiveReload 
…
<> 
Live-Coding 
Basic Terminal usage
Commands 
cd Change directory 
cd .. Go back one directory 
cd ~ Go to Home 
ls List directory 
touch Create file 
rm Remove file 
mkdir Make directory 
rmdir Remove directory
<> 
Live-Coding 
SASS in the command line
Basic SASS commands 
sass input.scss output.css Compile once 
sass --watch input.scss:output.css Watch file 
sass --watch scss:css Watch folder
Partials 
|stylesheets 
|--style.css 
/* Buttons */ 
/* Panels */ 
/* Lists */ 
CSS
Partials 
|stylesheets 
|--partials 
|------_buttons.scss 
|------_panels.scss 
|------_lists.scss 
|--vendor 
|----_normalize.scss 
|--style.scss 
@import “partials/buttons”; 
@import “partials/panels”; 
@import “partials/lists”; 
// Third-party stylesheets 
@import “vendor/normalize”; 
SCSS 
style.css
<> 
Live-Coding 
SASS playground
Variables 
$color = red; 
$darkercolor = darken($color, 25%); 
$lightercolor = lighten($color, 15%); 
adjust-hue(); 
saturate(); 
mix(); 
grayscale(); 
desaturate(); 
invert(); 
complement();
Nesting 
.my-style { 
.highlight { 
a { 
&:hover { 
} 
} 
} 
}
Fewer HTTP requests 
|stylesheets 
|--partials 
|------_buttons.scss 
|------_panels.scss 
|------_lists.scss 
|--vendor 
|----_normalize.scss 
|--style.scss 
style.css
Conditionals, Loops & Functions 
@function sample($var1, $var2) { 
… } 
@for $i from 1 through 10 { 
… } 
@mixin block($var1) { 
@if $var1 == large { 
… } 
}
Scratching the surface
Further information 
❏ www.thesassway.com 
❏ www.sass-lang.com 
❏ www.leveluptuts.com/tutorials/sass-tutorials 
❏ Dan Cederholm – “SASS for Web-Designers” 
❏ www.sassmeister.com
Questions? Feedback? 
@ferdinandvogler

More Related Content

PDF
SMACSS Workshop
PDF
Object Oriented CSS for rapid, scalable and maintainable development
PDF
What's Object-Oriented CSS (japanese)
PPTX
CSS Meetup at The Hive in Rock Hill, SC - 2014
PDF
Tech talk on Tailwind CSS
PDF
Refresh OKC
PDF
How to write css
PDF
Steve Barman - CSS and WordPress
SMACSS Workshop
Object Oriented CSS for rapid, scalable and maintainable development
What's Object-Oriented CSS (japanese)
CSS Meetup at The Hive in Rock Hill, SC - 2014
Tech talk on Tailwind CSS
Refresh OKC
How to write css
Steve Barman - CSS and WordPress

Viewers also liked (13)

PDF
PDF
Comandos huawei-prof
PDF
Catalogo 2015 baja
PPT
Emotion reading of siren tech
PPTX
ZOO PATRYK
PPTX
Behaviour As Predictor of Dementia
PDF
Oportunidades en biotecnología 2014
PDF
ThanksGiving
PDF
EPM Top Trends 2016
PPTX
Titles and credits
PPTX
Pest analizi
PPTX
You're losing money, and don't even know it: How to maximize your law firm ga...
PDF
Proyecto vocacional 2012 2014
Comandos huawei-prof
Catalogo 2015 baja
Emotion reading of siren tech
ZOO PATRYK
Behaviour As Predictor of Dementia
Oportunidades en biotecnología 2014
ThanksGiving
EPM Top Trends 2016
Titles and credits
Pest analizi
You're losing money, and don't even know it: How to maximize your law firm ga...
Proyecto vocacional 2012 2014
Ad

Similar to CSS with superpowers - SASS! (20)

PDF
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
PDF
Intro to Sass for WordPress Developers
PPTX
SCSS Implementation
PPT
An Introduction to CSS Frameworks
PPT
UNIT 3.ppt
PPT
PPTX
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
PPTX
BDUG Responsive Web Theming - 7/23/12
PDF
How to Use the Command Line to Increase Speed of Development
PDF
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
PDF
Knowing it all
PDF
960 grid psd
PPT
Using a CSS Framework
PDF
Hardboiled Front End Development — Found.ation
PDF
Death of a Themer
PDF
CSS framework By Palash
PDF
Web Summer Camp Keynote
PPTX
Elegant CSS Design In Drupal: LESS vs Sass
PDF
Create a landing page
KEY
Authoring Stylesheets with Compass & Sass
Dallas Drupal Days 2012 - Introduction to less sass-compass
 
Intro to Sass for WordPress Developers
SCSS Implementation
An Introduction to CSS Frameworks
UNIT 3.ppt
The New UI - Staying Strong with Flexbox, SASS, and {{Mustache.js}}
BDUG Responsive Web Theming - 7/23/12
How to Use the Command Line to Increase Speed of Development
Not Just a Pretty Face: How to design and build a cross-CMS CSS framework
Knowing it all
960 grid psd
Using a CSS Framework
Hardboiled Front End Development — Found.ation
Death of a Themer
CSS framework By Palash
Web Summer Camp Keynote
Elegant CSS Design In Drupal: LESS vs Sass
Create a landing page
Authoring Stylesheets with Compass & Sass
Ad

Recently uploaded (20)

PPTX
12. Community Pharmacy and How to organize it
PPTX
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
PDF
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
PPTX
mahatma gandhi bus terminal in india Case Study.pptx
PDF
Interior Structure and Construction A1 NGYANQI
PPTX
AD Bungalow Case studies Sem 2.pptxvwewev
DOCX
actividad 20% informatica microsoft project
PDF
Quality Control Management for RMG, Level- 4, Certificate
PPTX
areprosthodontics and orthodonticsa text.pptx
PPT
EGWHermeneuticsffgggggggggggggggggggggggggggggggg.ppt
PPT
UNIT I- Yarn, types, explanation, process
PPTX
Fundamental Principles of Visual Graphic Design.pptx
PPT
Machine printing techniques and plangi dyeing
PDF
The Advantages of Working With a Design-Build Studio
PPTX
An introduction to AI in research and reference management
PDF
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
PDF
YOW2022-BNE-MinimalViableArchitecture.pdf
PDF
Phone away, tabs closed: No multitasking
PPTX
CLASS_11_BUSINESS_STUDIES_PPT_CHAPTER_1_Business_Trade_Commerce.pptx
PDF
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...
12. Community Pharmacy and How to organize it
BSCS lesson 3.pptxnbbjbb mnbkjbkbbkbbkjb
Key Trends in Website Development 2025 | B3AITS - Bow & 3 Arrows IT Solutions
mahatma gandhi bus terminal in india Case Study.pptx
Interior Structure and Construction A1 NGYANQI
AD Bungalow Case studies Sem 2.pptxvwewev
actividad 20% informatica microsoft project
Quality Control Management for RMG, Level- 4, Certificate
areprosthodontics and orthodonticsa text.pptx
EGWHermeneuticsffgggggggggggggggggggggggggggggggg.ppt
UNIT I- Yarn, types, explanation, process
Fundamental Principles of Visual Graphic Design.pptx
Machine printing techniques and plangi dyeing
The Advantages of Working With a Design-Build Studio
An introduction to AI in research and reference management
Integrated-2D-and-3D-Animation-Bridging-Dimensions-for-Impactful-Storytelling...
YOW2022-BNE-MinimalViableArchitecture.pdf
Phone away, tabs closed: No multitasking
CLASS_11_BUSINESS_STUDIES_PPT_CHAPTER_1_Business_Trade_Commerce.pptx
Design Thinking - Module 1 - Introduction To Design Thinking - Dr. Rohan Dasg...

CSS with superpowers - SASS!

  • 1. CSS with superpowers ― SASS! Ferdinand Vogler @ferdinandvogler
  • 2. Ferdinand Vogler @ferdinandvogler Communication Design student, Working student at YOU IS NOW, Freelance Designer and Web-Developer
  • 4. OpenTechSchool opentechschool.org Berlin, Brussels, Dortmund, Hamburg, Istanbul, Jerusalem, London, Melbourne, Nairobi, Ramallah, RheinMain, Stockholm, San Francisco, Tel- Aviv, Washington, Zürich
  • 5. “If you really want to learn how to do something, try teaching other people how to do it.” – Steve Krug, Rocket Surgery Made Easy
  • 7. 1996 First W3C recommendation (CSS1)
  • 10. Advantages ❏ Variables ❏ Nesting ❏ Reusable blocks ❏ Fewer HTTP requests ❏ Conditionals, Loops & Functions ❏ Mathematics Don’t Repeat Yourself
  • 11. How does it work? style.scss Preprocessor style.css
  • 12. style.css scss a { color: gray; } a:hover { color: black; font-weight: bold; } p { margin: 10px; }
  • 13. “Later, when you’ve become fluent with Sass […], it really does feel like a natural extension of CSS — as if it’s filling holes we all wish were filled by the CSS spec itself.” Dan Cederholm in alistapart.com/article/why-sass
  • 15. Nope.
  • 17. style.scss style.sass @mixin border-radius($radius) { -webkit-border-radius: $radius; -moz-border-radius: $radius; -ms-border-radius: $radius; border-radius: $radius; } #main { background: gray; width: 50%; @include border-radius(4px); p { background: lightgray; color: black; } } =border-radius($radius) ––-webkit-border-radius: $radius ––-moz-border-radius: $radius ––-ms-border-radius: $radius ––border-radius: $radius #main ––background: gray ––width: 50% ––+border-radius(4px) ––p ––––background: lightgray ––––color: black
  • 19. Ruby Gems Mac Open Terminal: ruby -v Windows Install from www.rubyinstaller.org
  • 20. Installation Mac sudo gem install sass Windows gem install sass
  • 21. Apps CodeKit Prepros Scout Koala Compass Hammer Mixture LiveReload …
  • 22. <> Live-Coding Basic Terminal usage
  • 23. Commands cd Change directory cd .. Go back one directory cd ~ Go to Home ls List directory touch Create file rm Remove file mkdir Make directory rmdir Remove directory
  • 24. <> Live-Coding SASS in the command line
  • 25. Basic SASS commands sass input.scss output.css Compile once sass --watch input.scss:output.css Watch file sass --watch scss:css Watch folder
  • 26. Partials |stylesheets |--style.css /* Buttons */ /* Panels */ /* Lists */ CSS
  • 27. Partials |stylesheets |--partials |------_buttons.scss |------_panels.scss |------_lists.scss |--vendor |----_normalize.scss |--style.scss @import “partials/buttons”; @import “partials/panels”; @import “partials/lists”; // Third-party stylesheets @import “vendor/normalize”; SCSS style.css
  • 28. <> Live-Coding SASS playground
  • 29. Variables $color = red; $darkercolor = darken($color, 25%); $lightercolor = lighten($color, 15%); adjust-hue(); saturate(); mix(); grayscale(); desaturate(); invert(); complement();
  • 30. Nesting .my-style { .highlight { a { &:hover { } } } }
  • 31. Fewer HTTP requests |stylesheets |--partials |------_buttons.scss |------_panels.scss |------_lists.scss |--vendor |----_normalize.scss |--style.scss style.css
  • 32. Conditionals, Loops & Functions @function sample($var1, $var2) { … } @for $i from 1 through 10 { … } @mixin block($var1) { @if $var1 == large { … } }
  • 34. Further information ❏ www.thesassway.com ❏ www.sass-lang.com ❏ www.leveluptuts.com/tutorials/sass-tutorials ❏ Dan Cederholm – “SASS for Web-Designers” ❏ www.sassmeister.com