Skip to content

Instantly share code, notes, and snippets.

@xav76
Created October 23, 2012 18:00
Show Gist options
  • Save xav76/3940372 to your computer and use it in GitHub Desktop.
Save xav76/3940372 to your computer and use it in GitHub Desktop.
A CodePen by bookcasey. 3D Text in Sass - 3D text effect using CSS3 text-shadow made easier to maintain with @for directive in Sass. Inspired by @mdo.

#3D Text in Sass

Inspired by @mdo

@import "compass"
=threeDtext($color, $depth, $harshess: 1%)
$all: ()
@for $i from 0 through $depth
$all: append($all, append(0 $i*1px 0, darken($color, $i*$harshess)), comma)
$all: append($all, 0 $depth*1px $depth*1px rgba(0,0,0,.5))
text-shadow: $all
h1
+threeDtext(#c9c1c1, 8, 3)
font-size: 72px
h1, p, a
color: #FFF5F5
font-family: Futura, sans-serif
text-align: center
text-transform: uppercase
border: none
outline: none
html
height: 100%
+background(linear-gradient(top, #C9231A, #940A03))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment