SASS
Syntactically Awesome Style Sheets
Syntactically Awesome Style Sheets
Ejemplos de sintaxis en SASS.
$pasto: #5c832f;
.camaleon{
color: $pasto;
}
.canguro{
.cangurito{
overflow: visible;
}
}
$abejas: 1000;
$polen: 100; // por abeja
.miel:after{
content: "#{$abejas*$polen}";
}
body{
margin:0;
padding:0;
}
@import "reset";
.hormiga{
background: #bd8d46;
}
%alas{
border-width:1px;
}
.hormiga-voladora{
@extend .hormiga;
@extend %alas;
}
@mixin icon($position: before, $icon: false) {
@if $position == both {
$position: 'before, &:after';
}
&:#{$position} {
@if $icon {
content: $icon;
font-family: 'Icons';
}
}
@content;
}
.horse{
@include icon($position: before, $icon: '\e600');
}
Un pequeño ejemplo.
@include keyframes(hover){
0%{
@include transform(translate(0, -100px) rotate(-10deg) scale(1));
}
50%{
@include transform(translate(0, 100px) rotate(10deg) scale(1.4));
}
100%{
@include transform(translate(0, -100px) rotate(-10deg) scale(1));
}
}
.elefante{
@include animation('hover' 5s infinite ease-in-out);
}
Archivo de configuración de Compass.
http_path = "./"
css_dir = "../css/"
sass_dir = ""
images_dir = "../images/"
javascripts_dir = "../js/"
fonts_dir = "../fonts/"
output_style = :compressed