Slide 1

Slide 1 text

CSS to SCSS Making the Switch

Slide 2

Slide 2 text

Rob Walker CTO of Papertrail.io Made the switch in September 2013, and have never looked back [email protected] @_rob_walker_

Slide 3

Slide 3 text

Coming up • Why you should use SCSS • Working with SCSS • Making the switch • Next steps • Questions

Slide 4

Slide 4 text

Resources • Examples from this talk at - 
 https://github.com/papertrailrob/frontendne-scss • http://sass-lang.com

Slide 5

Slide 5 text

Why should you use SCSS • Easy to learn, and you can start today • Makes CSS more powerful • Will make your life easier

Slide 6

Slide 6 text

Working with SCSS • Nesting • Variables • Partials • Mixins

Slide 7

Slide 7 text

Nesting • Your HTML is in a nested hierarchy. Your CSS can be to. • Write less • Read more easily

Slide 8

Slide 8 text

Example

Slide 9

Slide 9 text

Variables • Define once, use everywhere • Control a whole layout or style from a few variables • Use the variables in calculations, colour modifiers and loads of other operators

Slide 10

Slide 10 text

Example

Slide 11

Slide 11 text

Partials and Import • Split SCSS into manageable chunks. • Organise your files • Import open source libraries

Slide 12

Slide 12 text

Example

Slide 13

Slide 13 text

Mixins • Reusable snippets of SCSS • Prevent repetition • Use open source mixins to make life easier

Slide 14

Slide 14 text

Example

Slide 15

Slide 15 text

How to make the switch • Install SCSS - sass-lang.com/install • Convert CSS to SCSS - Just rename .css to .scss • Generate SCSS - scss styles.scss:styles.css • Play and learn (and read the docs)

Slide 16

Slide 16 text

Example

Slide 17

Slide 17 text

Next steps • Try SCSS out yourself • Read the guide at sass-lang.com/guide • Check out the Frameworks (Compass, Bourbon, Susy)

Slide 18

Slide 18 text

Questions