4. You can be part of our staff!
inQbation is looking for two great
developers
HTML, CSS and Js lover?You can be our nextFront-end
developer
Enjoycodingin Python, PHP and Drupal?Then the back-end
developer spotcould be yours
6. About me
Python, PHP
HTML, CSS, JavaScript
Drupal
CrazyaboutUX and User Centered Design
Playingwith Node.js and MongoDB
7. So, aCSS preprocessor receive some instructions and compile
them to .css files
What are CSS Preprocessors?
From Wikipedia:
...apreprocessor is aprogramthatprocesses its
inputdatato produce outputthatis used as
inputto another program.
8. And what can I do with them?
Have you ever dream aboutusingthe advantages of a
programminglanguage with CSS?Well, that's whatwe are able
to do with CSS preprocessors.
Use variables, functions, mixins, and more.
15. Enough talking man, show me
the code!
Since we don'thave enough time to learn SaSS features from
basics to advanced, I'llshow the coolestones so you can research
deeper later.
Youcangoto tolearnmorehttp://sass-lang.com/documentation
17. Now, the same code, written in SaSS. Let's begin with variables
//Youcandefinevariables.
//BTW,commentslikethiswon'tcompileinyourCSS
$main_fg_color:#666;
$secondary_fg_color:#333;
h1{
font-size:20px;
color:$main_fg_color;
}
p{
color:$main_fg_color;
}
.content{
overflow:hidden;
background-color:#F6F6F6;
}
.contenth1{
font-size:18px;
color:$secondary_fg_color;
}
.contentp{
font-size:12px;
text-shadow:1px1px0#000;
color:$secondary_fg_color;
}
.contentpa{
color:$main_fg_color;
text-decoration:none;
}
SaSS allows you to use variables, so you can stick to the DRY
principle and keep the code simple and easyto maintain.
Gisthttp://sassmeister.com/gist/9771767
23. Functions
No more child games!Let's use CSS as aprogramminglanguage
@functionset-background($img:false,$color:#F4F4F4)
{
@if$img!=false{
@return#{$color}url(#{$img})no-repeatlefttop;
}
@else{
@return#{$color};
}
}
.container{
background:set-background("photo.png",#000);
}
Notan usefulfunction, but.. it's afunction inside CSS!
Gisthttp://sassmeister.com/gist/9772407
24. Control Directives
I betyou saw the @if statementin the lastslide, well, there is
more for you.
//Createaquickgrid
/*Numberofcolumns*/
$columns:12;
@for$ifrom1through$columns{
.col-#{$i}{
width:(100%/$columns)*$i;
float:left;
}
}
You can use @if, @else if, @else, @for, @each and @while
Gisthttp://sassmeister.com/gist/9772438
25. Control Directives
Now, the same grid butusingafunction
@functionget-col-width($width,$columns,$number){
@return($width/$columns)*$number;
}
$columns:6;
@for$ifrom1through$columns{
.columns-#{$i}{
width:get-col-width(960px,$columns,$i);
@if$i<$columns{
float:left;
}
@else{
float:right;
}
}
}
Gisthttp://sassmeister.com/gist/9772499
26. Wait! It gets even better!
Reinventingthe wheelis notnice...
You can reuse Compass mixins, functions and more.
27. Compass
Abrief example with Compass
Gisthttp://sassmeister.com/gist/9773018
And let's proceed with some questions.