public
Last active

Sass Snippets

  • Download Gist
multiple-text-shadows.scss
SCSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
// 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);
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.