On Github neb636 / UI-UX
gem install sass
gem install compass
# SASS Watch
function sw {
[ "$1" != "" ] && watch=$1 && shift || watch=sass/styles.scss:css/styles.css
sass --watch -l -t compressed $watch
}
#main
color: blue
font-size: 0.3em
a
font:
weight: bold
family: serif
&:hover
background-color: #eee
.menuWrap {
position: relative;
.mainNavigation {
border-right: 1px solid #eeeeee;
}
.menuItem {
width: 2em;
}
}
.menuWrap {
position: relative;
}
.menuWrap .mainNavigation {
border-right: 1px solid #eeeeee;
}
.menuWrap .menuItem {
width: 2em;
}
.stats {
h3 & {
fontsize: 12px;
}
}
// Compiles to
h3 .stats {
fontsize: 12px;
}
$darkgrey: #333333;
$lightblue: #001eff;
// now we can use them in our code:
.myClass {
color: $darkgrey;
a {
color: $lightblue;
}
}
.mo-better-percentage {
width: percentage(320px / 960px);
}
// compiles to
.mo-better-percentage {
0.9583333333333334%
}
.foo {
color: red;
}
.bar {
@extend .foo;
}
.foo, .bar {
color: red;
}
@mixin border-radius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
-o-border-radius: $radius;
border-radius: $radius;
}
h3 {
@include border-radius(3px);
}
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
$length : 42em;
$int : strip-unit($length); // 42
#page {
width: 100%;
@include mq(mobile) { width: 80%; }
}
#page {
width: 100%;
@include mq(480, 550) { width: 80%; }
@include mq(480) { width: 50%; }
}