Created
September 16, 2014 02:55
-
-
Save hergaiety/da5b1e8436ce2df210ab to your computer and use it in GitHub Desktop.
Google Material Design Shadow SASS Mixin Helper
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
/** | |
* Google Material Design style card depth | |
* Can receive an int between -5 and 5 (negatives use inset shadows) ex: @include depth(5); @include depth(-3) | |
*/ | |
@mixin depth($layer) { | |
@if $layer > 0 { | |
$inset: 0; | |
$offset: null; | |
} @else { | |
$inset: inset; | |
$offset: 1px; | |
$layer: $layer * -1; | |
} | |
box-shadow: $inset $offset 1px*($layer/2) 4px*$layer rgba(100, 100, 100, .2*$layer); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this require Compass?