Skip to content

Instantly share code, notes, and snippets.

@chriseppstein
Created January 5, 2011 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chriseppstein/767141 to your computer and use it in GitHub Desktop.
Save chriseppstein/767141 to your computer and use it in GitHub Desktop.
@import "compass/css3";
@function shadow-3d($text-color, $shadow-color) {
$shadows: compact();
@for $i from 1 through 5 {
$shadows: append($shadows, 0 1px * $i 0 scale-color($text-color, $lightness: 20% + $i * 5%));
}
@each $values in (6px 1px 0.1, 0 5px 0.1, 1px 3px 0.3, 3px 5px 0.2, 5px 10px 0.25, 10px 10px 0.2, 20px 20px 0.15) {
$shadows: append($shadows, 0 nth($values, 1) nth($values, 2) change-color($shadow-color, $alpha: nth($values, 3)));
}
@return $shadows;
}
h1 {
@include text-shadow(shadow-3d(#fff, black))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment