Skip to content

Instantly share code, notes, and snippets.

@kvendrik
Last active August 29, 2015 14:06
Show Gist options
  • Save kvendrik/8563afe3b9f3e00e4d39 to your computer and use it in GitHub Desktop.
Save kvendrik/8563afe3b9f3e00e4d39 to your computer and use it in GitHub Desktop.
Simple SASS boilerplate (mixins and variables)
//Border
@mixin border($side:false, $color:$grey-light){
@if $side {
border-#{$side}: $border-style $border-width $color;
} @else {
border: $border-style $border-width $color;
}
}
//Prefix property
@mixin prefix($property, $value){
-webkit-#{$property}: $value;
-moz-#{$property}: $value;
-o-#{$property}: $value;
-ms-#{$property}: $value;
#{$property}: $value;
}
//Transition
@mixin transition($property, $duration:$transition-duration, $timing:$transition-timing, $delay:0s){
@include prefix(transition, $property $duration $timing $delay);
}
//Animations
@mixin animation($name, $seconds, $delay:0s){
@include prefix(animation, $name $seconds infinite alternate $delay);
}
@mixin keyframes($name){
@-webkit-keyframes $name {
@content;
}
@-moz-keyframes $name {
@content;
}
@-o-keyframes $name {
@content;
}
@keyframes $name {
@content;
}
}
//Transforms
@mixin transform($value){
@include prefix(transform, $value);
}
$main-container-width: 960px;
//COLORS
$bg-color: #f5f5f5;
$base-color: #484848;
$base-color-light: lighten($base-color, 30%);
$white: #fff;
$accent: #3796cf;
$accent-dark: darken($accent, 20%);
$accent-hover: darken($accent, 5%);
$accent-alt: #4648ae;
$accent-alt-dark: darken($accent-alt, 20%);
$accent-alt-hover: darken($accent-alt, 5%);
$grey: #d9d9d9;
$grey-light: #f1f1f1;
//TYPOGRAPHY
$main-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
$main-weight: 300;
$bold-weight: 500;
$line-height: 1.5em;
$line-height-alt: 1.2em;
$size-xs: 0.5em;
$size-s: 0.85em;
$size-m: 16px;
$size-l: 1.1em;
//SPACING
$margin-xs: 5px;
$margin-s: 10px;
$margin-m: 20px;
$margin-l: 40px;
$margin-xl: 80px;
$padding-s: $margin-s $margin-s+5;
$padding-m: $margin-m;
$padding-l: $margin-m+10px $margin-l;
//BORDERS
$border-style: solid;
$border-width: 1px;
$border-width-alt: 2px;
$border-radius: 0;
//ANIMATIONS
$transition-duration: .3s;
$transition-duration-alt: .1s;
$transition-timing: ease;
//ELEMENTS
$header-height: 74px;
$sidebar-width: 250px;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment