Created
February 18, 2012 05:02
-
-
Save nimbupani/1857529 to your computer and use it in GitHub Desktop.
Sass Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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