Created
June 29, 2014 19:07
-
-
Save tddewey/46630f8c4daff34283d5 to your computer and use it in GitHub Desktop.
Edge skew mixin from GeekyLibrary
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
// edge-skew | |
// Applies a psudo element ot the left or right of an element | |
// that skews that edge. Basically adds a triangle of a given | |
// color in a direction | |
// @param $direction 'left'|'right' | |
// @param $color color | |
@mixin edge-skew( $direction, $color ) { | |
position: relative; | |
$pseudo: if($direction == left, before, after); | |
&:#{$pseudo} { | |
content: ' '; | |
position: absolute; | |
height: 100%; | |
background: $color; | |
min-width: 5px; | |
width: 7%; | |
transform: skew(-$branded-skew); | |
@if $direction == right { | |
right: 0; | |
transform-origin: bottom left; | |
} | |
@if $direction == left { | |
left: 0; | |
transform-origin: top left; | |
} | |
top: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment