Created
May 19, 2013 00:24
-
-
Save nathankot/5606205 to your computer and use it in GitHub Desktop.
Powerful Stylus mixin to create 3D text
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
three-dee-text($color = baseColor, $size = 7, $strength = 5%, $shadowing = .3) | |
$size = unit($size, '') | |
$text-shadow = '0 0 0 ' + rgba($color) | |
color $color | |
for n in 1..$size | |
$color = darken($color, $strength) | |
push($text-shadow, 0 unit(n, 'px') 0 $color) | |
push($text-shadow, 0 unit(n+1, 'px') unit(n - 1, 'px') rgba(0,0,0,$shadowing)) | |
push($text-shadow, 0 unit(n+1, 'px') 1px rgba(0,0,0,.5)) | |
text-shadow unquote(join(', ', $text-shadow)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment