Created
August 11, 2013 17:15
-
-
Save nladart/6205935 to your computer and use it in GitHub Desktop.
A CodePen by Daniel Ott. Long Shadow Sass Mixin - A mixin to create easily create the newest fad in design: long shadows!
This file contains hidden or 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
<div class="banner"> | |
<h1>Long Shadows</h1> | |
<h2>Sass Mixin for Long Shadows</h2> | |
</div> |
This file contains hidden or 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
@import "compass"; | |
@function makelongshadow($color) { | |
$val: 0px 0px $color; | |
@for $i from 1 through 200 { | |
$val: #{$val}, #{$i}px #{$i}px #{$color}; | |
} | |
@return $val; | |
} | |
@mixin longshadow($color) { | |
text-shadow: makelongshadow($color); | |
} | |
$color: #E13E06; | |
.banner { | |
padding: 100px; | |
text-align: center; | |
overflow: hidden; | |
border-bottom: 5px solid #ccc; | |
background-color: $color; | |
h1, h2 { | |
line-height: 1; | |
margin: 0; | |
color: #fff; | |
} | |
h1 { | |
font-size: 75px; | |
@include longshadow(darken($color, 5% )); | |
} | |
h2 { | |
font-size: 40px; | |
@include longshadow(darken($color, 8% )); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment