Skip to content

Instantly share code, notes, and snippets.

@joshuarule
Last active January 2, 2016 12:59
Show Gist options
  • Save joshuarule/8306673 to your computer and use it in GitHub Desktop.
Save joshuarule/8306673 to your computer and use it in GitHub Desktop.
Multiple Text Shadows
.hot-1 {
text-shadow: 0 -52px 0 rgba(255, 213, 0, 0.2);
}
.cold-1 {
text-shadow: 0 52px 0 rgba(0, 153, 153, 0.2);
}
.hot-2 {
text-shadow: 0 -52px 0 rgba(255, 213, 0, 0.2) , 0 -104px 0 rgba(255, 128, 0, 0.4);
}
.cold-2 {
text-shadow: 0 52px 0 rgba(0, 153, 153, 0.2) , 0 104px 0 rgba(0, 102, 153, 0.4);
}
.hot-3 {
text-shadow: 0 -52px 0 rgba(255, 213, 0, 0.2) , 0 -104px 0 rgba(255, 128, 0, 0.4) , 0 -156px 0 rgba(255, 86, 0, 0.6);
}
.cold-3 {
text-shadow: 0 52px 0 rgba(0, 153, 153, 0.2) , 0 104px 0 rgba(0, 102, 153, 0.4) , 0 156px 0 rgba(0, 76, 153, 0.6);
}
.hot-4 {
text-shadow: 0 -52px 0 rgba(255, 213, 0, 0.2) , 0 -104px 0 rgba(255, 128, 0, 0.4) , 0 -156px 0 rgba(255, 86, 0, 0.6) , 0 -208px 0 rgba(255, 43, 0, 0.8);
}
.cold-4 {
text-shadow: 0 52px 0 rgba(0, 153, 153, 0.2) , 0 104px 0 rgba(0, 102, 153, 0.4) , 0 156px 0 rgba(0, 76, 153, 0.6) , 0 208px 0 rgba(0, 51, 153, 0.8);
}
.hot-5 {
text-shadow: 0 -52px 0 rgba(255, 213, 0, 0.2) , 0 -104px 0 rgba(255, 128, 0, 0.4) , 0 -156px 0 rgba(255, 86, 0, 0.6) , 0 -208px 0 rgba(255, 43, 0, 0.8) , 0 -260px 0 red;
}
.cold-5 {
text-shadow: 0 52px 0 rgba(0, 153, 153, 0.2) , 0 104px 0 rgba(0, 102, 153, 0.4) , 0 156px 0 rgba(0, 76, 153, 0.6) , 0 208px 0 rgba(0, 51, 153, 0.8) , 0 260px 0 #001a99;
}
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
$hot-color: #ffd500;
$cold-color: #009999;
@function multiple-text-shadow ($n, $color, $distance, $hue-adjust) {
$value: '0 ' + $distance + ' 0 ' + rgba($color, .2);
@for $i from 2 through $n {
$value: '#{$value} , 0 #{$i * $distance} 0 ' + adjust-hue(rgba($color, ($i*.2)), ($i * $hue-adjust));
}
@return unquote($value);
}
// spits out classes for multiple shadows
$shadow-distance: 52px;
@for $i from 1 through 5 {
.hot-#{$i} {
text-shadow: multiple-text-shadow($i, $hot-color, -$shadow-distance, -10);
}
.cold-#{$i} {
text-shadow: multiple-text-shadow($i, $cold-color, $shadow-distance, 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment