Sass introduction through the main concepts - 2016

16
The police of stylesheets = @bneiluj - All right reserved. Session 1 (B.Y.O.L.)

Transcript of Sass introduction through the main concepts - 2016

Page 1: Sass introduction through the main concepts - 2016

The police of stylesheets

=

@bneiluj - All right reserved.

Session 1

(B.Y.O.L.)

Page 2: Sass introduction through the main concepts - 2016

JulienBouteloup

cannot Be sued for potential grammatical errors … or non - sense.

100% Sassy

@bneiluj

Page 3: Sass introduction through the main concepts - 2016

First: What is Css ?

“CSS on its own can be FUN (awful), but

stylesheets are getting larger, more complex,

and harder to maintain.”

This is where a preprocessor can help...

full repetitions !

unclear relationships !

no process !

Page 4: Sass introduction through the main concepts - 2016

“Sass lets you use features that don't exist in CSS yet like variables, nesting, mixins, inheritance and other nifty goodies that make writing CSS Sass fun again. “

FUN

smartPrettyRobust

Solution ? Sass ! such a surprise :-)

Page 5: Sass introduction through the main concepts - 2016

Let’s get start !

Setup:

> Sass --watch filename.scss

it will watch your changes and compile them into css

Rubygems.orgRuby

Page 6: Sass introduction through the main concepts - 2016

Comments:

yes

//

/****/

Nothing!

Page 7: Sass introduction through the main concepts - 2016

Variables: Variables

The variable call !

Page 8: Sass introduction through the main concepts - 2016

Nesting:

compiled css

Page 9: Sass introduction through the main concepts - 2016

Import:

Reset file here !

Sass builds on top of the current CSS

@import but instead of requiring an

HTTP request, Sass will take the file that

you want to import and combine it

with the file you're importing into so

you can serve a single CSS file to the

web browser.

Page 10: Sass introduction through the main concepts - 2016

Mixins:

Include your mixin here and pass 10px as a parameter!

Because you want to reuse border-radius

use a variable $radius

Page 11: Sass introduction through the main concepts - 2016

Extend:

Your css is not duplicated !

compiled css

Page 12: Sass introduction through the main concepts - 2016

Functions:

use a MATH expressions

parameters

Return value

compiled css

How to use it

Page 13: Sass introduction through the main concepts - 2016

well… and now ?

Page 14: Sass introduction through the main concepts - 2016

Organiseyour Sass code and Files

Page 15: Sass introduction through the main concepts - 2016

Live Demo !

Page 16: Sass introduction through the main concepts - 2016

Session 2 ?

Full sass

ViewPort

Media Queries

100% refactored

FUN

Automatic

build a 100% Sass homepage !