Skip to content

Instantly share code, notes, and snippets.

@paprikka
Created May 27, 2012 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paprikka/2814630 to your computer and use it in GitHub Desktop.
Save paprikka/2814630 to your computer and use it in GitHub Desktop.
SCSS: 3d shadow
// usage text-shadow / box-shadow : shadow-3d($color, $length);
// adds pseudo-3d vertical shadow
@function shadow-3d($col, $h){
$str : "";
$shadow-col : darken($col, 5%);
@for $i from 1 through $h{
$str : "#{$str} 0 #{$i}px 0 #{$shadow-col},";
}
$str : "#{$str} 0 #{$h}px 10px rgba(0,0,0,.6), 0 #{$h}px 4px rgba(0,0,0,.4)" ;
@return unquote($str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment