Sass Basics

Installing

sudo gem install sass

Enter computer password


Running

pwd to show current folder

cd and path to your site to get to correct folder

sass --watch --style expanded sass/style.scss:style.css to run Sass


Features

Importing

@import "reset"; to import _reset.scss

Indenting &:hover, etc.

Variables

$variable: value;

Media queries

$viewport-ipad: 1024px;
$viewport-iphone: 414px;

@mixin responsive($viewport-width) {
    @if $viewport-width == ipad {
        @media screen and (max-width: $viewport-ipad) {
            @content;
        }
    }
    @else if $viewport-width == iphone {
        @media screen and (max-width: $viewport-iphone) {
            @content;
        }
    }
}

and

@include responsive(iphone) {
        ...
}