Skip to content

Instantly share code, notes, and snippets.

@nimbupani
Created February 18, 2012 05:02
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nimbupani/1857529 to your computer and use it in GitHub Desktop.
Save nimbupani/1857529 to your computer and use it in GitHub Desktop.
Sass Snippets
// Use as -> text-shadow: blockytextshadows(1 5, #fff #eee);
@function blockytextshadows($widths, $colors) {
$count: length($colors);
$total: 0;
$output: '';
$currentwidth: 1;
@each $width in $widths {
$total: $total + $width;
}
@for $j from 1 through $count {
$width: nth($widths, $j);
@for $i from $currentwidth to ($currentwidth + $width) {
$color: nth($colors, $j);
$output: $output + '#{$color} #{$i}px #{$i}px 1px';
@if( $i < $total) {
$output: $output + ', ';
}
}
$currentwidth: $currentwidth + $width;
}
@return unquote($output);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment