Skip to content

Instantly share code, notes, and snippets.

@fredyang
Created February 18, 2014 03:53
Show Gist options
  • Save fredyang/9064380 to your computer and use it in GitHub Desktop.
Save fredyang/9064380 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.4)
// Compass (v1.0.0.alpha.18)
// ----
@function combine($prefix, $list) {
$temp: "";
$n: length($list);
@for $i from 1 through $n {
@if $i == $n {
$temp: $temp + $prefix + nth($list, $i) ;
} @else {
$temp: $temp + $prefix + nth($list, $i) + ",";
}
}
@return $temp;
}
@mixin log($comment, $value: null) {
@if $value == null {
/* debug: #{$comment} */
} @else {
/* debug: #{$comment}:#{$value} */
}
}
//@include combine("fred", a, b, c...)
@include log(combine("prefix_", a b c))
/* debug: prefix_a,prefix_b,prefix_c */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment