Top Banner
Getting SASSy with front end development
49

Getting SASSy with front end development

Jul 26, 2015

Download

Design

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Getting SASSy with front end development

Getting SASSy with front end development

Page 2: Getting SASSy with front end development

The Studio of Matthew Carleton

Web Design, development and branding

@matthewcarleton

matthewcarleton.com

Page 3: Getting SASSy with front end development

What’s the deal with SASS?

Page 4: Getting SASSy with front end development

Who’s heard of SASS?

Page 5: Getting SASSy with front end development

Who’s used SASS?

Page 6: Getting SASSy with front end development

[SYNTACTICALLY AWESOME STYLESHEETS]

Page 7: Getting SASSy with front end development

What we will talk about1. SASS? 2. Who is SASS for 3. Features of SASS 4. Setting up SASS 5. Libraries & Resources

Page 8: Getting SASSy with front end development

What is SASS?

Page 9: Getting SASSy with front end development

SASS is a preprocessor for your CSS

</> </>

input.scss output.css

Page 10: Getting SASSy with front end development

Who is SASS for?

Page 11: Getting SASSy with front end development

I am not a programmer

Page 12: Getting SASSy with front end development

I don’t want to be a programmer

Page 13: Getting SASSy with front end development
Page 14: Getting SASSy with front end development

Organized CSS

Page 15: Getting SASSy with front end development

The Problem with CSSRepetitive

Difficult to maintain

Unorganized

Page 16: Getting SASSy with front end development

Core Features of SASSVariables

Nesting

Mixins

@import

Page 17: Getting SASSy with front end development

VariablesSay goodbye to HEX Values

Page 18: Getting SASSy with front end development

VariablesSay goodbye to HEX values

A variable allows you to pull in values that you only define once. If you are looking for one reason to switch to SASS variables are it.

SCSS

Page 19: Getting SASSy with front end development

VariablesSay goodbye to HEX values

Once defined variables can then be used through-out your SASS.

SCSS CSS

Page 20: Getting SASSy with front end development

VariablesMaking life simpler

Strings of text Colours

Hex values Numbers

Boolean values Value lists

SCSS CSS

Page 21: Getting SASSy with front end development

NestingStop repeating yourself

Page 22: Getting SASSy with front end development

NestingStop repeating yourself

Nesting allows you to nest child elements under parent elements.

SCSSCSS

Page 23: Getting SASSy with front end development

NestingThe all powerful “&”

Using the “&” helps with pseudo elements, pseudo classes, and class extensions.

SCSSCSS

Page 24: Getting SASSy with front end development

NestingThe all powerful “&”

Using the “&” helps with pseudo elements, pseudo classes, and class extensions.

SCSSCSS

Page 25: Getting SASSy with front end development

NestingThe all powerful “&”

Using the “&” helps with pseudo elements, pseudo classes, and class extensions.

HTML

Page 26: Getting SASSy with front end development

NestingThe all powerful “&”

Using the “&” helps with pseudo elements, pseudo classes, and class extensions.

SCSSCSS

Page 27: Getting SASSy with front end development

NestingCommenting and spacing

Commenting and spacing keeps your SASS legible.

SCSS SCSS

Page 28: Getting SASSy with front end development

MixinsReusable chunks of CSS

Page 29: Getting SASSy with front end development

MixinsReusable chunks of CSS

Create a mixin by declaring “@mixin mixin-name”. Call a mixin by declaring “@include mixin-name”.

SCSS

Page 30: Getting SASSy with front end development

MixinsArguments

Using arguments in your mixins makes them so much better!

SCSS

Page 31: Getting SASSy with front end development

MixinsArguments

Arguments accept default values as fallbacks if no value is given.

SCSS

Page 32: Getting SASSy with front end development

@importFor the Obsessive Compulsive

Page 33: Getting SASSy with front end development

@import

</> </>

input.scss

</>

variables.scss

</>

mixins.scss

</>

type.scss

output.css

Page 34: Getting SASSy with front end development

@importFor the Obsessive Compulsive

Keeping your styles organized just got so much easier with @import.

SCSS

Page 35: Getting SASSy with front end development

@importFor the Obsessive Compulsive

Keeping your styles organized just got so much easier with @import.

SCSS

Page 36: Getting SASSy with front end development

@import

Page 37: Getting SASSy with front end development

Setting up SASSThe dreaded terminal

Page 38: Getting SASSy with front end development

Setting up SASSThe dreaded terminal

Page 39: Getting SASSy with front end development

Setting up SASSStep 1 : Install SASS

$ gem install sass

Page 40: Getting SASSy with front end development

Setting up SASSStep 2 : Watch

$ sass —watch sass/styles.scss:css/styles.css

Page 41: Getting SASSy with front end development

Setting up SASSBonus : Output style

Page 42: Getting SASSy with front end development

Setting up SASSBonus : Output style

Nested Expanded Compact

Compressed

$ sass — watch sass/styles.scss:css/styles.css — style compressed

Page 43: Getting SASSy with front end development

Setting up SASSWindows Users :(

Page 44: Getting SASSy with front end development

Setting up SASSWindows Users :(

http://rubyinstaller.org

Page 45: Getting SASSy with front end development

LibrariesDon’t reinvent the wheel.

SASS libraries make it much easier to implement things that otherwise would require a lot more CSS.

Page 46: Getting SASSy with front end development

LibrariesDon’t reinvent the wheel.

SCSS

Page 47: Getting SASSy with front end development

CSS

LibrariesDon’t reinvent the wheel.

Page 48: Getting SASSy with front end development

Resources

http://sass-lang.com

http://sassmeister.com

http://livereload.com

Page 49: Getting SASSy with front end development

THANK YOU

@matthewcarleton matthewcarleton.com