Skip to content

Instantly share code, notes, and snippets.

@kawasako
Created August 26, 2013 16:06
Show Gist options
  • Save kawasako/6343196 to your computer and use it in GitHub Desktop.
Save kawasako/6343196 to your computer and use it in GitHub Desktop.
// Example
@mixin hoge($num, $str){
// if $num
@if $num < 10 {
margin-top: $num;
}@else{
margin-top: 15px;
}
// if $str
float: $str;
@if $str == left {
margin-right: 5px;
}@elseif $str == right {
margin-left: 5px;
}
}
.fuga {
@include hoge(11px, left);
}
.mogo {
@include hoge(5px, right);
}
// Result
.fuga {
margin-top: 15px;
float: left;
padding-right: 5px;
}
.mogo {
margin-top: 5px;
float: right;
padding-left: 5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment